Class BlockDragonEgg

All Implemented Interfaces:
BlockID, IBlockState, IMutableBlockState, AxisAlignedBB, Metadatable, Cloneable

public class BlockDragonEgg extends BlockFallable
  • Constructor Details

    • BlockDragonEgg

      public BlockDragonEgg()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in class Block
    • getId

      public int getId()
      Specified by:
      getId in class Block
    • getHardness

      public double getHardness()
      Description copied from class: Block
      控制方块硬度
      Overrides:
      getHardness in class Block
      Returns:
      方块的硬度
    • getResistance

      public double getResistance()
      Description copied from class: Block
      控制方块爆炸抗性
      Overrides:
      getResistance in class Block
      Returns:
      方块的爆炸抗性
    • getLightLevel

      public int getLightLevel()
      Description copied from class: Block
      控制方块的发光等级
      Overrides:
      getLightLevel in class Block
      Returns:
      发光等级(0 - 15)
    • isTransparent

      public boolean isTransparent()
      Description copied from class: Block
      控制方块是否透明(默认为false)
      Overrides:
      isTransparent in class Block
      Returns:
      方块是否透明
    • getWaterloggingLevel

      @PowerNukkitOnly public int getWaterloggingLevel()
      Overrides:
      getWaterloggingLevel in class Block
    • onUpdate

      public int onUpdate(int type)
      Overrides:
      onUpdate in class BlockFallable
    • onTouch

      @Since("1.4.0.0-PN") @PowerNukkitOnly public int onTouch(@Nullable Player player, PlayerInteractEvent.Action action)
      Description copied from class: Block
      当玩家使用与左键或者右键方块时会触发,常被用于处理例如物品展示框左键掉落物品这种逻辑
      触发点在Player的onBlockBreakStart中

      It will be triggered when the player uses the left or right click on the block, which is often used to deal with logic such as left button dropping items in the item frame
      The trigger point is in the onBlockBreakStart of Player

      Overrides:
      onTouch in class Block
      Parameters:
      player - the player
      action - the action
      Returns:
      状态值,返回值不为0代表这是一个touch操作而不是一个挖掘方块的操作
      Status value, if the return value is not 0, it means that this is a touch operation rather than a mining block operation
    • teleport

      public void teleport()
    • breaksWhenMoved

      @PowerNukkitOnly public boolean breaksWhenMoved()
      Overrides:
      breaksWhenMoved in class Block
      Returns:
      当被活塞移动时是否会被破坏
    • sticksToPiston

      @PowerNukkitOnly public boolean sticksToPiston()
      Overrides:
      sticksToPiston in class Block
      Returns:
      是否可以粘在粘性活塞上