public class MobSpawnerBlock extends BaseBlock
Constructor and Description |
---|
MobSpawnerBlock(BlockState blockState)
Construct the mob spawner block with a specified data value.
|
MobSpawnerBlock(BlockState blockState,
java.lang.String mobType)
Construct the mob spawner block.
|
Modifier and Type | Method and Description |
---|---|
short |
getDelay()
Get the spawn delay.
|
java.lang.String |
getMobType()
Get the mob type.
|
CompoundTag |
getNbtData()
Get the object's NBT data (tile entity data).
|
java.lang.String |
getNbtId()
Return the name of the title entity ID.
|
boolean |
hasNbtData()
Returns whether the block contains NBT data.
|
void |
setDelay(short delay)
Set the spawn delay.
|
void |
setMobType(java.lang.String mobType)
Set the mob type.
|
void |
setNbtData(CompoundTag rootTag)
Set the object's NBT data (tile entity data).
|
equals, equalsFuzzy, getBlockType, getState, getStates, hashCode, toBaseBlock, toBaseBlock, toImmutableState, toString, with
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
applyBlock, getAsString
public MobSpawnerBlock(BlockState blockState)
blockState
- The block statepublic MobSpawnerBlock(BlockState blockState, java.lang.String mobType)
blockState
- The block statemobType
- mob typepublic java.lang.String getMobType()
public void setMobType(java.lang.String mobType)
mobType
- the mob typepublic short getDelay()
public void setDelay(short delay)
delay
- the delay to setpublic boolean hasNbtData()
NbtValued
NbtValued.getNbtData()
must not return null if this method returns true.hasNbtData
in interface NbtValued
hasNbtData
in class BaseBlock
public java.lang.String getNbtId()
TileEntityBlock
getNbtId
in interface TileEntityBlock
getNbtId
in class BaseBlock
public CompoundTag getNbtData()
NbtValued
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.
getNbtData
in interface NbtValued
getNbtData
in class BaseBlock
public void setNbtData(CompoundTag rootTag)
NbtValued
setNbtData
in interface NbtValued
setNbtData
in class BaseBlock
rootTag
- NBT data, or null if no data