Package org.bukkit.block.spawner
Class SpawnerEntry
java.lang.Object
org.bukkit.block.spawner.SpawnerEntry
Represents a weighted spawn potential that can be added to a monster spawner.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets 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.voidsetSnapshot(EntitySnapshot snapshot) Sets theEntitySnapshotfor this SpawnerEntry.voidsetSpawnRule(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
public SpawnerEntry(@NotNull EntitySnapshot snapshot, int spawnWeight, @Nullable SpawnRule spawnRule)
-
-
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
Gets a copy of theSpawnRulefor this SpawnerEntry, or null if none has been set.- Returns:
- a copy of the spawn rule or null
-
setSpawnRule
Sets theSpawnRulefor this SpawnerEntry, null may be used to clear the current spawn rule.- Parameters:
spawnRule- the new spawn rule to use or null
-