EntityInteractEvent

Link to entityinteractevent

This event is fired on both sides whenever the player interacts with an entity.

The event is cancelable.

If the event is canceled, will cause the entity to not be interacted with

The event does not have a result.

Importing the class

Link to importing-the-class

Importing the class is recommended for events, simply add this line to the top of your script file.

ZenScript
Copy
import crafttweaker.neoforge.api.event.interact.EntityInteractEvent;

Listening to the event

Link to listening-to-the-event

ZenScript
Copy
events.register<crafttweaker.neoforge.api.event.interact.EntityInteractEvent>(event => {
    println("EntityInteractEvent ran!");
});

EntityInteractEvent extends PlayerInteractEvent. That means all methods available in PlayerInteractEvent are also available in EntityInteractEvent

Implemented Interfaces

Link to implemented-interfaces

EntityInteractEvent implements the following interfaces. That means all methods defined in these interfaces are also available in EntityInteractEvent

NameTypeHas GetterHas Setter
Name
target
Type
Entity
Has Getter
true
Has Setter
false