BlockToolModificationEvent
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.neoforge.api.event.block.BlockToolModificationEvent;
Extends
BlockToolModificationEvent extends BlockEvent
.
Implements
BlockToolModificationEvent
implements the following interfaces:
Listening to the event
This event can be listened to like so:
events.register<crafttweaker.neoforge.api.event.block.BlockToolModificationEvent>(event => { println("BlockToolModificationEvent ran!");});
Members
cancel()
Cancels the event. Same as script.zs
setCanceled(true)
// BlockToolModificationEvent.cancel();event.cancel();
Getter
// BlockToolModificationEvent.canceled as boolevent.canceled
Return Type:
bool
Setter
// BlockToolModificationEvent.canceled = (cancel as bool);event.canceled = myBool;
Parameters:
cancel: bool
Type: bool
canceled() as bool
// BlockToolModificationEvent.canceled() as bool;event.canceled();
Return Type:
bool
canceled(cancel as bool)
// BlockToolModificationEvent.canceled(cancel as bool);event.canceled(myBool);
Parameters:
cancel: bool
Type: bool
Getter
// BlockToolModificationEvent.context as UseOnContextevent.context
Return Type:
UseOnContext
Getter
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.script.zs
// BlockToolModificationEvent.finalState as BlockStateevent.finalState
Return Type:
BlockState
Setter
Sets the transformed state after tool use. If not set, will return the original state. This will be bypassed if canceled, returning null instead.script.zs
event.finalState = myBlockState;
Parameters:
state: BlockState
Type: BlockState
Getter
// BlockToolModificationEvent.hasResult as boolevent.hasResult
Return Type:
bool
hasResult() as bool
// BlockToolModificationEvent.hasResult() as bool;event.hasResult();
Return Type:
bool
Getter
// BlockToolModificationEvent.heldItemStack as IItemStackevent.heldItemStack
Return Type:
IItemStack
Getter
// BlockToolModificationEvent.isSimulated as boolevent.isSimulated
Return Type:
bool
Getter
// BlockToolModificationEvent.level as LevelAccessorevent.level
Return Type:
LevelAccessor
Getter
// BlockToolModificationEvent.result as EventResultevent.result
Return Type:
EventResult
Setter
event.result = myResult;
Parameters:
result: EventResult
Type: EventResult
result() as Result
result(result as Result)
event.result(myResult);
Parameters:
result: EventResult
Type: EventResult
setAllow()
sets the event's result to script.zs
allow
// BlockToolModificationEvent.setAllow();event.setAllow();
setDefault()
sets the event's result to script.zs
default
// BlockToolModificationEvent.setDefault();event.setDefault();
setDeny()
sets the event's result to script.zs
deny
// BlockToolModificationEvent.setDeny();event.setDeny();
Getter
// BlockToolModificationEvent.state as BlockStateevent.state
Return Type:
BlockState
Getter
// BlockToolModificationEvent.toolAction as ToolActionevent.toolAction
Return Type:
ToolAction