mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Add LivingSwapHandItemsEvent
This commit is contained in:
1 parent
09bc73d5cd
commit
00ad61b4ae
6 files changed
+154
-1
No files matched your search
@@ -160,6 +160,7 @@ import net.minecraftforge.event.entity.living.LivingChangeTargetEvent.ILivingTar
|
||||
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.LivingSwapItemsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingUseTotemEvent;
|
||||
import net.minecraftforge.event.entity.living.LootingLevelEvent;
|
||||
import net.minecraftforge.event.entity.living.ShieldBlockEvent;
|
||||
@@ -1226,6 +1227,13 @@ public class ForgeHooks
|
||||
return e;
|
||||
}
|
||||
|
||||
public static LivingSwapItemsEvent.Hands onLivingSwapHandItems(LivingEntity livingEntity)
|
||||
{
|
||||
LivingSwapItemsEvent.Hands event = new LivingSwapItemsEvent.Hands(livingEntity);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
return event;
|
||||
}
|
||||
|
||||
public static void writeAdditionalLevelSaveData(WorldData worldData, CompoundTag levelTag)
|
||||
{
|
||||
CompoundTag fmlData = new CompoundTag();
|
||||
@@ -1536,7 +1544,7 @@ public class ForgeHooks
|
||||
* Handles living entities being under water. This fires the {@link LivingBreatheEvent} and if the entity's air supply
|
||||
* is less than or equal to zero also the {@link LivingDrownEvent}. Additionally when the entity is under water it will
|
||||
* dismount if {@link IForgeEntity#canBeRiddenUnderFluidType(FluidType, Entity)} returns false.
|
||||
*
|
||||
*
|
||||
* @param entity The living entity which is currently updated
|
||||
* @param consumeAirAmount The amount of air to consume when the entity is unable to breathe
|
||||
* @param refillAirAmount The amount of air to refill when the entity is able to breathe
|
||||
|
||||
Reference in new issue
Block a user