Java Code Examples for net.minecraftforge.event.entity.living.LivingDeathEvent#getEntity()
The following examples show how to use
net.minecraftforge.event.entity.living.LivingDeathEvent#getEntity() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModuleEffectBackup.java From Wizardry with GNU Lesser General Public License v3.0 | 5 votes |
@SubscribeEvent public static void onZombieDeath(LivingDeathEvent e) { if(e.getEntity() instanceof EntityBackupZombie) { if(((EntityBackupZombie)e.getEntity()).getOwner() != null) { WizardryWorld world = WizardryWorldCapability.get(e.getEntity().world); if(world != null) { world.decBackupCount(((EntityBackupZombie)e.getEntity()).getOwner()); } } } }
Example 2
Source File: EntityLivingHandler.java From TFC2 with GNU General Public License v3.0 | 5 votes |
@SubscribeEvent public void onEntityDeath(LivingDeathEvent event) { EntityLivingBase entity = event.getEntityLiving(); if(event.getEntity().world.isRemote) return; if (entity instanceof EntityPlayer) { //Removed on port /*EntityPlayer player = (EntityPlayer) entity; SkillStats skills = TFC_Core.getSkillStats(player); PlayerInfo pi = PlayerManagerTFC.getInstance().getPlayerInfoFromPlayer(player); pi.tempSkills = skills; // Save the item in the back slot if keepInventory is set to true. if (entityIn.world.getGameRules().getGameRuleBooleanValue("keepInventory") && player.inventory instanceof InventoryPlayerTFC) { pi.tempEquipment = ((InventoryPlayerTFC) player.inventory).extraEquipInventory.clone(); }*/ } if(entity.getEntityData().hasKey("TFC2")) { /*NBTTagCompound nbt = entity.getEntityData().getCompoundTag("TFC2"); if(nbt.getBoolean("isWild")) { IslandMap map = Core.getMapForWorld(event.getEntity().getEntityWorld(), event.getEntity().getPosition()); SpawnEntry entry = map.getIslandData().animalEntries.get(nbt.getString("SpawnGroup")); entry.removeAnimal(); }*/ } }