mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Add a cancellable event that gets fired when a Totem of Undying is used (#9069)
This commit is contained in:
1 parent
aae628cd18
commit
be5dab5801
3 files changed
+78
No files matched your search
@@ -138,6 +138,7 @@ import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingKnockBackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingUseTotemEvent;
|
||||
import net.minecraftforge.event.entity.living.LootingLevelEvent;
|
||||
import net.minecraftforge.event.entity.living.ShieldBlockEvent;
|
||||
import net.minecraftforge.event.entity.player.AdvancementEvent;
|
||||
@@ -317,6 +318,11 @@ public class ForgeHooks
|
||||
return event;
|
||||
}
|
||||
|
||||
public static boolean onLivingUseTotem(LivingEntity entity, DamageSource damageSource, ItemStack totem, InteractionHand hand)
|
||||
{
|
||||
return !MinecraftForge.EVENT_BUS.post(new LivingUseTotemEvent(entity, damageSource, totem, hand));
|
||||
}
|
||||
|
||||
public static float onLivingHurt(LivingEntity entity, DamageSource src, float amount)
|
||||
{
|
||||
LivingHurtEvent event = new LivingHurtEvent(entity, src, amount);
|
||||
|
||||
Reference in new issue
Block a user