PlayerHarvestCheckEvent
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.forge.api.event.entity.player.PlayerHarvestCheckEvent;
Extends
PlayerHarvestCheckEvent extends PlayerEvent
.
Listening to the event
This event can be listened to like so:
events.register<crafttweaker.forge.api.event.entity.player.PlayerHarvestCheckEvent>(event => { println("PlayerHarvestCheckEvent ran!");});
Members
cancel()
Cancels the event. Same as script.zs
setCanceled(true)
// HarvestCheck.cancel();event.cancel();
Getter
// HarvestCheck.cancelable as boolevent.cancelable
Return Type:
bool
cancelable() as bool
// HarvestCheck.cancelable() as bool;event.cancelable();
Return Type:
bool
Getter
// HarvestCheck.canceled as boolevent.canceled
Return Type:
bool
Setter
// HarvestCheck.canceled = (cancel as bool);event.canceled = myBool;
Parameters:
cancel: bool
Type: bool
canceled() as bool
// HarvestCheck.canceled() as bool;event.canceled();
Return Type:
bool
canceled(cancel as bool)
// HarvestCheck.canceled(cancel as bool);event.canceled(myBool);
Parameters:
cancel: bool
Type: bool
Getter
// HarvestCheck.canHarvest as boolevent.canHarvest
Return Type:
bool
Setter
// HarvestCheck.canHarvest = (success as bool);event.canHarvest = myBool;
Parameters:
success: bool
Type: bool
Getter
Getter
// HarvestCheck.entity as LivingEntityevent.entity
Return Type:
LivingEntity
Getter
Getter
// HarvestCheck.hasResult as boolevent.hasResult
Return Type:
bool
hasResult() as bool
// HarvestCheck.hasResult() as bool;event.hasResult();
Return Type:
bool
Getter
// HarvestCheck.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
// HarvestCheck.setAllow();event.setAllow();
setDefault()
sets the event's result to script.zs
default
// HarvestCheck.setDefault();event.setDefault();
setDeny()
sets the event's result to script.zs
deny
// HarvestCheck.setDeny();event.setDeny();
Getter
// HarvestCheck.targetBlock as BlockStateevent.targetBlock
Return Type:
BlockState