The PlayerInteract Event is fired whenever a player interacts with a block.

You will need to cast the event in the function header as this class:
crafttweaker.event.PlayerInteractEvent
You can, of course, also import the class before and use that name then.

Erweiterte Event-Schnittellen

Link to erweiterte-event-schnittellen

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

Die folgenden Informationen lassen sich von diesem Event (Ereignis) abrufen:

ZenGetterRückgabetyp
ZenGetter
canceled
Rückgabetyp
boolean
ZenGetter
usingItem
Rückgabetyp
boolean
ZenGetter
usingBlock
Rückgabetyp
boolean
ZenGetter
x
Rückgabetyp
int
ZenGetter
y
Rückgabetyp
int
ZenGetter
z
Rückgabetyp
int
ZenGetter
face
Rückgabetyp
IFacing
ZenGetter
player
Rückgabetyp
IPlayer
ZenGetter
world
Rückgabetyp
IWorld
ZenGetter
block
Rückgabetyp
IBlock
ZenGetter
item
Rückgabetyp
IItemStack
ZenGetter
dimension
Rückgabetyp
int
  • event.cancel() sets the event as cancelled
  • event.useBlock() sets usingBlock to true
  • event.useItem() sets usingItem to true
  • event.damageItem(int amount) damages the item by the specified amount