类 PlayerEvent.HarvestCheck

java.lang.Object
net.minecraftforge.eventbus.api.Event
封闭类:
PlayerEvent

public static class PlayerEvent.HarvestCheck extends PlayerEvent
HarvestCheck is fired when a player attempts to harvest a block.
This event is fired whenever a player attempts to harvest a block in Player.hasCorrectToolForDrops(BlockState).

This event is fired via the ForgeEventFactory.doPlayerHarvestCheck(Player, BlockState, boolean).

state contains the BlockState that is being checked for harvesting.
success contains the boolean value for whether the Block will be successfully harvested.

This event is not Cancelable.

This event does not have a result. Event.HasResult

This event is fired on the MinecraftForge.EVENT_BUS.
  • 字段详细资料

    • state

      private final BlockState state
    • success

      private boolean success
  • 构造器详细资料

    • HarvestCheck

      public HarvestCheck(Player player, BlockState state, boolean success)
  • 方法详细资料

    • getTargetBlock

      public BlockState getTargetBlock()
    • canHarvest

      public boolean canHarvest()
    • setCanHarvest

      public void setCanHarvest(boolean success)