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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents the equipment loot table applied to a spawned entity. -
Constructor Summary
ConstructorDescriptionSpawnerEntry
(EntitySnapshot snapshot, int spawnWeight, SpawnRule spawnRule) SpawnerEntry
(EntitySnapshot snapshot, int spawnWeight, SpawnRule spawnRule, SpawnerEntry.Equipment equipment) -
Method Summary
Modifier and TypeMethodDescriptionGets the equipment which will be applied to the spawned entity.Gets theEntitySnapshot
for this SpawnerEntry.Gets a copy of theSpawnRule
for this SpawnerEntry, or null if none has been set.int
Gets the weight for this SpawnerEntry, when added to a spawner entries with higher weight will spawn more often.void
setEquipment
(SpawnerEntry.Equipment equipment) Sets the equipment which will be applied to the spawned entity.void
setSnapshot
(EntitySnapshot snapshot) Sets theEntitySnapshot
for this SpawnerEntry.void
setSpawnRule
(SpawnRule spawnRule) Sets theSpawnRule
for this SpawnerEntry, null may be used to clear the current spawn rule.void
setSpawnWeight
(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) -
SpawnerEntry
public SpawnerEntry(@NotNull EntitySnapshot snapshot, int spawnWeight, @Nullable SpawnRule spawnRule, @Nullable SpawnerEntry.Equipment equipment)
-
-
Method Details
-
getSnapshot
Gets theEntitySnapshot
for this SpawnerEntry.- Returns:
- the snapshot
-
setSnapshot
Sets theEntitySnapshot
for 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 theSpawnRule
for this SpawnerEntry, or null if none has been set.- Returns:
- a copy of the spawn rule or null
-
setSpawnRule
Sets theSpawnRule
for this SpawnerEntry, null may be used to clear the current spawn rule.- Parameters:
spawnRule
- the new spawn rule to use or null
-
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
-