PlayerInteract
Link to playerinteract
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:
ZenGetters
Link to zengetters
Следующая информация может быть получена от события:
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 |
ZenMethods
Link to zenmethods
event.cancel()
sets the event as cancelledevent.useBlock()
sets usingBlock to trueevent.useItem()
sets usingItem to trueevent.damageItem(int amount)
damages the item by the specified amount