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 SummaryNested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingSwapItemsEventLivingSwapItemsEvent.HandsNested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEventLivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEventEntityEvent.EnteringSection, EntityEvent.EntityConstructingNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.voidSets the item that will be swapped to the main hand of the entity.voidSets the item that will be swapped to the offhand of the entity.Methods inherited from class net.minecraftforge.event.entity.living.LivingEventgetEntityMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
toMainHand
- 
toOffHand
 
- 
- 
Constructor Details- 
Hands
 
- 
- 
Method Details- 
getItemSwappedToMainHandGets the item that will be swapped to the main hand of the entity.- Returns:
- The item that will be swapped to the main hand.
 
- 
getItemSwappedToOffHandGets the item that will be swapped to the offhand of the entity.- Returns:
- The item that will be swapped to the offhand.
 
- 
setItemSwappedToMainHandSets the item that will be swapped to the main hand of the entity.- Parameters:
- item- The item to swap to the main hand.
 
- 
setItemSwappedToOffHandSets the item that will be swapped to the offhand of the entity.- Parameters:
- item- The item to swap to the offhand.
 
 
-