Package net.minecraftforge.event.world
Class WorldEvent.PotentialSpawns
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.world.WorldEvent
net.minecraftforge.event.world.WorldEvent.PotentialSpawns
- Enclosing class:
- WorldEvent
Called by WorldServer to gather 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 in
WorldServer#getSpawnListEntryForTypeAt(EnumCreatureType, BlockPos)
as well as
WorldServer#canCreatureTypeSpawnHere(EnumCreatureType, SpawnListEntry, BlockPos)
where the latter checks for identity, meaning both events must add the same instance.
Canceling the event will result in a empty list, meaning no entity will be spawned.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.world.WorldEvent
WorldEvent.CreateSpawnPosition, WorldEvent.Load, WorldEvent.PotentialSpawns, WorldEvent.Save, WorldEvent.Unload
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<MobSpawnInfo.Spawners>
private final BlockPos
private final EntityClassification
-
Constructor Summary
ConstructorDescriptionPotentialSpawns
(IWorld world, EntityClassification type, BlockPos pos, List<MobSpawnInfo.Spawners> oldList) -
Method Summary
Methods inherited from class net.minecraftforge.event.world.WorldEvent
getWorld
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
type
-
pos
-
list
-
-
Constructor Details
-
PotentialSpawns
public PotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, List<MobSpawnInfo.Spawners> oldList)
-
-
Method Details
-
getType
-
getPos
-
getList
-