LivingEntityUseItem

Link to livingentityuseitem

The LivingEntityUseItem event is fired whenever an entity starts using an item, stops doing so, after the player finishes using an item and each tick they use the item.
Since that would be called far too often, there are 4 subEvents that are only called in their specific case.

Importing the class

Link to importing-the-class

It might be required to import the class to avoid errors.

ZenScript
Copy
//Base Event
import crafttweaker.event.EntityLivingUseItemEvent.All;

//Specific Events
import crafttweaker.event.EntityLivingUseItemEvent.Start;
import crafttweaker.event.EntityLivingUseItemEvent.Tick;
import crafttweaker.event.EntityLivingUseItemEvent.Stop;
import crafttweaker.event.EntityLivingUseItemEvent.Finish;

Event interface extensions

Link to event-interface-extensions

LivingEntityUseItem Events implement the following interfaces and are able to call all of their methods/getters/setters as well:

ZenGetters/ZenSetters

Link to zengetterszensetters

The following information can be retrieved/set during the event:

ZenGetterZenSetterType
ZenGetter
player
ZenSetter
Type
IPlayer
ZenGetter
isPlayer
ZenSetter
Type
bool
ZenGetter
item
ZenSetter
Type
IItemStack
ZenGetter
duration
ZenSetter
duration
Type
int

ZenGetters/ZenSetters/ZenMethods from extensions

Link to zengetterszensetterszenmethods-from-extensions

The following information can be retrieved/set during the event:

ZenGetterZenSetterType
ZenGetter
entityLivingBase
ZenSetter
Type
IEntityLivingBase
ZenGetter
canceled
ZenSetter
canceled
Type
bool

ZenMethods

  • event.cancel(); Method, returns void (nothing). Can cancel the event and stop something from happening