Class MobSpawnerBlock

java.lang.Object
com.sk89q.worldedit.world.block.BaseBlock
com.sk89q.worldedit.blocks.MobSpawnerBlock
All Implemented Interfaces:
TileEntityBlock, Pattern, BlockStateHolder<BaseBlock>, NbtValued

public class MobSpawnerBlock extends BaseBlock
A mob spawner block.
  • Constructor Details

    • MobSpawnerBlock

      public MobSpawnerBlock(BlockState blockState)
      Construct the mob spawner block with a specified data value.
      Parameters:
      blockState - The block state
    • MobSpawnerBlock

      public MobSpawnerBlock(BlockState blockState, String mobType)
      Construct the mob spawner block.
      Parameters:
      blockState - The block state
      mobType - mob type
  • Method Details

    • getMobType

      public String getMobType()
      Get the mob type.
      Returns:
      the mob type
    • setMobType

      public void setMobType(String mobType)
      Set the mob type.
      Parameters:
      mobType - the mob type
    • getDelay

      public short getDelay()
      Get the spawn delay.
      Returns:
      the delay
    • setDelay

      public void setDelay(short delay)
      Set the spawn delay.
      Parameters:
      delay - the delay to set
    • hasNbtData

      public boolean hasNbtData()
      Description copied from interface: NbtValued
      Returns whether the block contains NBT data. NbtValued.getNbtData() must not return null if this method returns true.
      Specified by:
      hasNbtData in interface NbtValued
      Overrides:
      hasNbtData in class BaseBlock
      Returns:
      true if there is NBT data
    • getNbtId

      public String getNbtId()
      Description copied from interface: TileEntityBlock
      Return the name of the title entity ID.
      Specified by:
      getNbtId in interface TileEntityBlock
      Overrides:
      getNbtId in class BaseBlock
      Returns:
      tile entity ID, non-null string
    • getNbtData

      public CompoundTag getNbtData()
      Description copied from interface: NbtValued
      Get the object's NBT data (tile entity data). The returned tag, if modified in any way, should be sent to NbtValued.setNbtData(CompoundTag) so that the instance knows of the changes. Making changes without calling NbtValued.setNbtData(CompoundTag) could have unintended consequences.

      NbtValued.hasNbtData() must return true if and only if method does not return null.

      Specified by:
      getNbtData in interface NbtValued
      Overrides:
      getNbtData in class BaseBlock
      Returns:
      compound tag, or null
    • setNbtData

      public void setNbtData(CompoundTag rootTag)
      Description copied from interface: NbtValued
      Set the object's NBT data (tile entity data).
      Specified by:
      setNbtData in interface NbtValued
      Overrides:
      setNbtData in class BaseBlock
      Parameters:
      rootTag - NBT data, or null if no data