Package net.minecraftforge.event.level
Class LevelEvent.PotentialSpawns
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.LevelEvent
net.minecraftforge.event.level.LevelEvent.PotentialSpawns
- Enclosing class:
- LevelEvent
Fired when building a list of all possible entities that can spawn at the specified location.
 
If an entry is added to the list, it needs to be a globally unique instance.
The event is called innet.minecraft.world.level.NaturalSpawner#mobsAt(ServerLevel, StructureManager, ChunkGenerator, MobCategory, RandomSource, BlockPos).
 
 This event is cancellable, and does not have a result. Canceling the event will result in an empty list, meaning no entity will be spawned.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.event.level.LevelEventLevelEvent.CreateSpawnPosition, LevelEvent.Load, LevelEvent.PotentialSpawns, LevelEvent.Save, LevelEvent.UnloadNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final List<MobSpawnSettings.SpawnerData>private final MobCategoryprivate final BlockPosprivate final List<MobSpawnSettings.SpawnerData>
- 
Constructor SummaryConstructorsConstructorDescriptionPotentialSpawns(LevelAccessor level, MobCategory category, BlockPos pos, WeightedRandomList<MobSpawnSettings.SpawnerData> oldList) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidAppends a SpawnerData entry to the spawn list.Returns the category of the mobs in the spawn list..getPos()Returns the block position where the chosen mob will be spawned..Returns the list of mobs that can potentially be spawned..booleanRemoves a SpawnerData entry from the spawn list.Methods inherited from class net.minecraftforge.event.level.LevelEventgetLevelMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
mobcategory
- 
pos
- 
list
- 
view
 
- 
- 
Constructor Details- 
PotentialSpawnspublic PotentialSpawns(LevelAccessor level, MobCategory category, BlockPos pos, WeightedRandomList<MobSpawnSettings.SpawnerData> oldList) 
 
- 
- 
Method Details- 
getMobCategoryReturns the category of the mobs in the spawn list..- Returns:
- the category of the mobs in the spawn list.
 
- 
getPosReturns the block position where the chosen mob will be spawned..- Returns:
- the block position where the chosen mob will be spawned.
 
- 
getSpawnerDataListReturns the list of mobs that can potentially be spawned..- Returns:
- the list of mobs that can potentially be spawned.
 
- 
addSpawnerDataAppends a SpawnerData entry to the spawn list.- Parameters:
- data- SpawnerData entry to be appended to the spawn list.
 
- 
removeSpawnerDataRemoves a SpawnerData entry from the spawn list.- Parameters:
- data- SpawnerData entry to be removed from the spawn list. Returns- trueif the spawn list contained the specified element..
 
 
-