java.lang.Object
com.shanebeestudios.nms.api.world.block.McBlock

public class McBlock extends Object
Wrapper for Minecraft Block

Provides easy-to-use mapped methods for Blocks

Keep in mind, a Minecraft Block differs from a Bukkit Block, A Minecraft Block is actually a TYPE, not a reference to a block in the world.

  • Method Details

    • wrap

      public static McBlock wrap(net.minecraft.world.level.block.Block block)
      Wrap a Minecraft Block as an McBlock
      Parameters:
      block - Minecraft block to wrap
      Returns:
      Wrapper for Minecraft Block
    • wrap

      public static McBlock wrap(Block bukkitBlock)
      Wrap a Bukkit Block as an McBlock

      Being different Block classes, this essentially grabs the type of a Bukkit Block

      Parameters:
      bukkitBlock - Bukkit Block to wrap
      Returns:
      Wrapper for Minecraft Block
    • asItem

      @Nullable public @Nullable net.minecraft.world.item.Item asItem()
      Get the Item version of this Block
      Returns:
      Item version of this Block
    • getFriction

      public float getFriction()
      Get the friction of this Block
      Returns:
      Friction of this block
    • getExplosionResistance

      public float getExplosionResistance()
      Get the explosion resistance of this Block
      Returns:
      Explosion resistance of this Block
    • getJumpFactor

      public float getJumpFactor()
      Get the jump factor of this Block
      Returns:
      Jump factor of this Block
    • getSpeedFactor

      public float getSpeedFactor()
      Get the speed factor of this Block
      Returns:
      Speed factor of this Block
    • hasCollision

      public boolean hasCollision()
      Check if this Block has collision
      Returns:
      True if Block has collision
    • isDestroyable

      public boolean isDestroyable()
      Check if this Block is destroyable
      Returns:
      True if Block is destroyable