MCBlockToolInteractEvent

Fired when when this block is right clicked by a tool to change its state. For example: Used to determine if an axe can strip a log, a shovel can turn grass into a path, or a hoe can till dirt into farmland.

The event is not cancelable.

The event does not have a result.

Diese Klasse importieren

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

import crafttweaker.api.event.block.MCBlockToolInteractEvent;

Extending MCBlockEvent

MCBlockToolInteractEvent extends MCBlockEvent. That means all methods available in MCBlockEvent are also available in MCBlockToolInteractEvent

Methoden

getFinalState

Gets the transformed state after tool use. If setFinalState is not called, it will return the original state. This will be bypassed if canceled, returning null instead.

Return Type: MCBlockState?

MCBlockToolInteractEvent.getFinalState() as MCBlockState?
myMCBlockToolInteractEvent.getFinalState();

getHeldItemStack

Return Type: IItemStack

MCBlockToolInteractEvent.getHeldItemStack() as IItemStack
myMCBlockToolInteractEvent.getHeldItemStack();

getPlayer

Return Type: MCPlayerEntity

MCBlockToolInteractEvent.getPlayer() as MCPlayerEntity
myMCBlockToolInteractEvent.getPlayer();

getToolType

Return Type: string

MCBlockToolInteractEvent.getToolType() as string
myMCBlockToolInteractEvent.getToolType();

setFinalState

Sets the transformed state after tool use. If not set, will return the original state. This will be bypassed if canceled, returning null instead.

Return Type: void

MCBlockToolInteractEvent.setFinalState(state as MCBlockState) as void
ParameterTypeBeschreibung
stateMCBlockStateNo Description Provided

Properties

NameTypeHas GetterHas Setter
finalStateMCBlockState?truetrue
heldItemStackIItemStacktruefalse
playerMCPlayerEntitytruefalse
toolTypestringtruefalse