Class SpawnerEntry
java.lang.Object
org.bukkit.block.spawner.SpawnerEntry
Represents a weighted spawn potential that can be added to a monster spawner.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the equipment loot table applied to a spawned entity. -
Constructor Summary
ConstructorsConstructorDescriptionSpawnerEntry(EntitySnapshot snapshot, int spawnWeight, @Nullable SpawnRule spawnRule) Creates a new spawner entry without equipment.SpawnerEntry(EntitySnapshot snapshot, int spawnWeight, @Nullable SpawnRule spawnRule, @Nullable SpawnerEntry.Equipment equipment) Creates a new spawner entry. -
Method Summary
Modifier and TypeMethodDescriptionGets the equipment which will be applied to the spawned entity.Gets theEntitySnapshotfor this SpawnerEntry.Gets a copy of theSpawnRulefor this SpawnerEntry, or null if none has been set.intGets the weight for this SpawnerEntry, when added to a spawner entries with higher weight will spawn more often.voidsetEquipment(@Nullable SpawnerEntry.Equipment equipment) Sets the equipment which will be applied to the spawned entity.voidsetSnapshot(EntitySnapshot snapshot) Sets theEntitySnapshotfor this SpawnerEntry.voidsetSpawnRule(@Nullable SpawnRule spawnRule) Sets theSpawnRulefor this SpawnerEntry, null may be used to clear the current spawn rule.voidsetSpawnWeight(int spawnWeight) Sets the weight for this SpawnerEntry, when added to a spawner entries with higher weight will spawn more often.
-
Constructor Details
-
SpawnerEntry
Creates a new spawner entry without equipment.- Parameters:
snapshot- the entity to spawnspawnWeight- the weight of this entryspawnRule- the rule that controls where the entity can spawn, or null to use the default spawn rules
-
SpawnerEntry
public SpawnerEntry(EntitySnapshot snapshot, int spawnWeight, @Nullable SpawnRule spawnRule, @Nullable SpawnerEntry.Equipment equipment) Creates a new spawner entry.- Parameters:
snapshot- the entity to spawnspawnWeight- the weight of this entryspawnRule- the rule that controls where the entity can spawn, or null to use the default spawn rulesequipment- the equipment loot table for the spawned entity, or null to not apply one
-
-
Method Details
-
getSnapshot
Gets theEntitySnapshotfor this SpawnerEntry.- Returns:
- the snapshot
-
setSnapshot
Sets theEntitySnapshotfor this SpawnerEntry.- Parameters:
snapshot- the snapshot
-
getSpawnWeight
public int getSpawnWeight()Gets the weight for this SpawnerEntry, when added to a spawner entries with higher weight will spawn more often.- Returns:
- the weight
-
setSpawnWeight
public void setSpawnWeight(int spawnWeight) Sets the weight for this SpawnerEntry, when added to a spawner entries with higher weight will spawn more often.- Parameters:
spawnWeight- the new spawn weight
-
getSpawnRule
-
setSpawnRule
-
getEquipment
Gets the equipment which will be applied to the spawned entity.- Returns:
- the equipment, or null
-
setEquipment
Sets the equipment which will be applied to the spawned entity.- Parameters:
equipment- new equipment, or null
-