BlockEvent

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.

script.zs
import crafttweaker.forge.api.event.block.BlockEvent;

Extends

BlockEvent extends Event.

Members

cancel()
Cancels the event. Same as setCanceled(true)
script.zs
// BlockEvent.cancel();
myBlockEvent.cancel();
Getter
script.zs
// BlockEvent.cancelable as bool
myBlockEvent.cancelable

Return Type: bool

cancelable() as bool
script.zs
// BlockEvent.cancelable() as bool;
myBlockEvent.cancelable();

Return Type: bool

Getter
script.zs
// BlockEvent.canceled as bool
myBlockEvent.canceled

Return Type: bool

Setter
script.zs
// BlockEvent.canceled = (cancel as bool);
myBlockEvent.canceled = myBool;

Parameters:

cancel Type: bool
canceled() as bool
script.zs
// BlockEvent.canceled() as bool;
myBlockEvent.canceled();

Return Type: bool

canceled(cancel as bool)
script.zs
// BlockEvent.canceled(cancel as bool);
myBlockEvent.canceled(myBool);

Parameters:

cancel Type: bool
Getter
script.zs
// BlockEvent.hasResult as bool
myBlockEvent.hasResult

Return Type: bool

hasResult() as bool
script.zs
// BlockEvent.hasResult() as bool;
myBlockEvent.hasResult();

Return Type: bool

Getter
script.zs
// BlockEvent.level as LevelAccessor
myBlockEvent.level

Return Type: LevelAccessor

Getter
script.zs
// BlockEvent.pos as BlockPos
myBlockEvent.pos

Return Type: BlockPos

Getter
script.zs
// BlockEvent.result as Result
myBlockEvent.result

Return Type: EventResult

Setter
script.zs
// BlockEvent.result = (result as Result);
myBlockEvent.result = myResult;

Parameters:

result Type: EventResult
result() as Result
script.zs
// BlockEvent.result() as Result;
myBlockEvent.result();

Return Type: EventResult

result(result as Result)
script.zs
// BlockEvent.result(result as Result);
myBlockEvent.result(myResult);

Parameters:

result Type: EventResult
setAllow()
sets the event's result to allow
script.zs
// BlockEvent.setAllow();
myBlockEvent.setAllow();
setDefault()
sets the event's result to default
script.zs
// BlockEvent.setDefault();
myBlockEvent.setDefault();
setDeny()
sets the event's result to deny
script.zs
// BlockEvent.setDeny();
myBlockEvent.setDeny();
Getter
script.zs
// BlockEvent.state as BlockState
myBlockEvent.state

Return Type: BlockState