public static boolean onLivingDrops( EntityLiving entity, DamageSource source, ArrayList<EntityItem> drops, int lootingLevel, boolean recentlyHit, int specialDropValue) { return MinecraftForge.EVENT_BUS.post( new LivingDropsEvent(entity, source, drops, lootingLevel, recentlyHit, specialDropValue)); }
public static EntityItem onPlayerTossEvent(EntityPlayer player, ItemStack item) { player.captureDrops = true; EntityItem ret = player.dropPlayerItemWithRandomChoice(item, false); player.capturedDrops.clear(); player.captureDrops = false; ItemTossEvent event = new ItemTossEvent(ret, player); if (MinecraftForge.EVENT_BUS.post(event)) { return null; } player.joinEntityItemWithWorld(event.entityItem); return event.entityItem; }
public static void onLivingJump(EntityLiving entity) { MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity)); }
public static float onLivingFall(EntityLiving entity, float distance) { LivingFallEvent event = new LivingFallEvent(entity, distance); return (MinecraftForge.EVENT_BUS.post(event) ? 0.0f : event.distance); }
public static boolean onLivingDeath(EntityLiving entity, DamageSource src) { return MinecraftForge.EVENT_BUS.post(new LivingDeathEvent(entity, src)); }
public static int onLivingHurt(EntityLiving entity, DamageSource src, int amount) { LivingHurtEvent event = new LivingHurtEvent(entity, src, amount); return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.ammount); }
public static boolean onLivingAttack(EntityLiving entity, DamageSource src, int amount) { return MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount)); }
public static boolean onLivingUpdate(EntityLiving entity) { return MinecraftForge.EVENT_BUS.post(new LivingUpdateEvent(entity)); }
// Optifine Helper Functions u.u, these are here specifically for Optifine // Note: When using Optfine, these methods are invoked using reflection, which // incurs a major performance penalty. public static void onLivingSetAttackTarget(EntityLiving entity, EntityLiving target) { MinecraftForge.EVENT_BUS.post(new LivingSetAttackTargetEvent(entity, target)); }
// @Mod.Init public void init(FMLInitializationEvent e) { MinecraftForge.EVENT_BUS.register(this); if (client != null) client.init(e); }