FarmlandTrampleEvent
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.FarmlandTrampleEvent;
Extends
FarmlandTrampleEvent extends BlockEvent
.
Implements
FarmlandTrampleEvent
implements the following interfaces:
Listening to the event
This event can be listened to like so:
events.register<crafttweaker.neoforge.api.event.block.FarmlandTrampleEvent>(event => { println("FarmlandTrampleEvent ran!");});
Members
cancel()
Cancels the event. Same as script.zs
setCanceled(true)
// FarmlandTrampleEvent.cancel();event.cancel();
Getter
// FarmlandTrampleEvent.canceled as boolevent.canceled
Return Type:
bool
Setter
// FarmlandTrampleEvent.canceled = (cancel as bool);event.canceled = myBool;
Parameters:
cancel: bool
Type: bool
canceled() as bool
// FarmlandTrampleEvent.canceled() as bool;event.canceled();
Return Type:
bool
canceled(cancel as bool)
// FarmlandTrampleEvent.canceled(cancel as bool);event.canceled(myBool);
Parameters:
cancel: bool
Type: bool
Getter
// FarmlandTrampleEvent.fallDistance as floatevent.fallDistance
Return Type:
float
Getter
// FarmlandTrampleEvent.hasResult as boolevent.hasResult
Return Type:
bool
hasResult() as bool
// FarmlandTrampleEvent.hasResult() as bool;event.hasResult();
Return Type:
bool
Getter
// FarmlandTrampleEvent.level as LevelAccessorevent.level
Return Type:
LevelAccessor
Getter
// FarmlandTrampleEvent.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
// FarmlandTrampleEvent.setAllow();event.setAllow();
setDefault()
sets the event's result to script.zs
default
// FarmlandTrampleEvent.setDefault();event.setDefault();
setDeny()
sets the event's result to script.zs
deny
// FarmlandTrampleEvent.setDeny();event.setDeny();
Getter
// FarmlandTrampleEvent.state as BlockStateevent.state
Return Type:
BlockState