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

Класс события

Link to класс-события

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.

Наследование от интерфейсов событий

Link to наследование-от-интерфейсов-событий

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

Следующая информация может быть получена от события:

ZenGetterВозвращаемый тип
ZenGetter
canceled
Возвращаемый тип
boolean
ZenGetter
usingItem
Возвращаемый тип
boolean
ZenGetter
usingBlock
Возвращаемый тип
boolean
ZenGetter
x
Возвращаемый тип
int
ZenGetter
y
Возвращаемый тип
int
ZenGetter
z
Возвращаемый тип
int
ZenGetter
face
Возвращаемый тип
IFacing
ZenGetter
player
Возвращаемый тип
IPlayer
ZenGetter
world
Возвращаемый тип
IWorld
ZenGetter
block
Возвращаемый тип
IBlock
ZenGetter
item
Возвращаемый тип
IItemStack
ZenGetter
dimension
Возвращаемый тип
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