Skip to content

Instantly share code, notes, and snippets.

@czaux
Created December 31, 2019 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czaux/2bc0b9fdef62ae37953fc6db6dfa8bf0 to your computer and use it in GitHub Desktop.
Save czaux/2bc0b9fdef62ae37953fc6db6dfa8bf0 to your computer and use it in GitHub Desktop.
@SubscribeEvent
public void EnteringChunk(net.minecraftforge.event.entity.EntityEvent.EnteringChunk event) {
if(KMCFConfig.Stop_Cellien_Spawns) {
if(event.getEntity() instanceof EntityPlayer) return;
if(event.getEntity() instanceof EntityLivingBase) {
Entity aa = event.getEntity();
String name = aa.getName();
if(name.indexOf("Cellien") != -1) {
//TODO: Probably match mod name but can't find how to do that.
switch(name) {
case "Cellien":
case "Red Cellien":
case "Big Cellien":
case "Big Red Cellien": {
this.handleCellienSpawn(aa);
}
default: {}
}
}
}
}
}
private void handleCellienSpawn(Entity entity) {
if(KMCFConfig.Stop_Cellien_Spawns) {
entity.setInvisible(true);
entity.setSilent(true);
World world = entity.getEntityWorld();
world.removeEntity(entity);
KMCFMod.logger.info("removed cellien");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment