类 LevelEvent.PotentialSpawns
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.LevelEvent
net.neoforged.neoforge.event.level.LevelEvent.PotentialSpawns
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
- 封闭类:
LevelEvent
public static class LevelEvent.PotentialSpawns
extends LevelEvent
implements net.neoforged.bus.api.ICancellableEvent
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 in引用无效
net.minecraft.world.level.NaturalSpawner#mobsAt(ServerLevel, StructureManager, ChunkGenerator, MobCategory, RandomSource, BlockPos)
This event is cancellable, and does not
.
Canceling the event will result in an empty list, meaning no entity will be spawned.引用无效
have a result
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.level.LevelEvent
LevelEvent.CreateSpawnPosition, LevelEvent.Load, LevelEvent.PotentialSpawns, LevelEvent.Save, LevelEvent.Unload
-
字段概要
字段修饰符和类型字段说明private final MobCategory
private final BlockPos
private List
<Weighted<MobSpawnSettings.SpawnerData>> -
构造器概要
构造器构造器说明PotentialSpawns
(LevelAccessor level, MobCategory category, BlockPos pos, WeightedList<MobSpawnSettings.SpawnerData> oldList) -
方法概要
修饰符和类型方法说明void
Appends a SpawnerData entry to the spawn list.返回 the category of the mobs in the spawn list.。getPos()
返回 the block position where the chosen mob will be spawned.。返回 the list of mobs that can potentially be spawned.。private void
makeList()
void
Removes a SpawnerData entry from the spawn list.从类继承的方法 net.neoforged.neoforge.event.level.LevelEvent
getLevel
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
mobcategory
-
pos
-
list
-
view
-
-
构造器详细资料
-
PotentialSpawns
public PotentialSpawns(LevelAccessor level, MobCategory category, BlockPos pos, WeightedList<MobSpawnSettings.SpawnerData> oldList)
-
-
方法详细资料
-
getMobCategory
返回 the category of the mobs in the spawn list.。- 返回:
- the category of the mobs in the spawn list.
-
getPos
返回 the block position where the chosen mob will be spawned.。- 返回:
- the block position where the chosen mob will be spawned.
-
getSpawnerDataList
返回 the list of mobs that can potentially be spawned.。- 返回:
- the list of mobs that can potentially be spawned.
-
makeList
private void makeList() -
addSpawnerData
Appends a SpawnerData entry to the spawn list.- 参数:
data
- SpawnerData entry to be appended to the spawn list.
-
removeSpawnerData
Removes a SpawnerData entry from the spawn list.- 参数:
data
- SpawnerData entry to be removed from the spawn list.
-