Class LivingSwapItemsEvent.Hands
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingSwapItemsEvent
net.minecraftforge.event.entity.living.LivingSwapItemsEvent.Hands
- Enclosing class:
- LivingSwapItemsEvent
This event is fired when a living entity is about to swap the items in their main and offhand.
This event is executed in
ServerGamePacketListenerImpl.handlePlayerAction(net.minecraft.network.protocol.game.ServerboundPlayerActionPacket)
This event is cancellable, and does not have a result.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingSwapItemsEvent
LivingSwapItemsEvent.Hands
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the item that will be swapped to the main hand of the entity.Gets the item that will be swapped to the offhand of the entity.void
Sets the item that will be swapped to the main hand of the entity.void
Sets the item that will be swapped to the offhand of the entity.Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
toMainHand
-
toOffHand
-
-
Constructor Details
-
Hands
-
-
Method Details
-
getItemSwappedToMainHand
Gets the item that will be swapped to the main hand of the entity.- Returns:
- The item that will be swapped to the main hand.
-
getItemSwappedToOffHand
Gets the item that will be swapped to the offhand of the entity.- Returns:
- The item that will be swapped to the offhand.
-
setItemSwappedToMainHand
Sets the item that will be swapped to the main hand of the entity.- Parameters:
item
- The item to swap to the main hand.
-
setItemSwappedToOffHand
Sets the item that will be swapped to the offhand of the entity.- Parameters:
item
- The item to swap to the offhand.
-