类 RegisterSpawnPlacementsEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.RegisterSpawnPlacementsEvent
- 所有已实现的接口:
net.neoforged.fml.event.IModBusEvent
public class RegisterSpawnPlacementsEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.fml.event.IModBusEvent
This event allows each
EntityType
to have a SpawnPlacements.SpawnPredicate
registered or modified.
Spawn Predicates are checked whenever an Entity
of the given EntityType
spawns in the world naturally.
If registering your own entity's spawn placements, you should use register(EntityType, SpawnPlacementType, Heightmap.Types, SpawnPlacements.SpawnPredicate, Operation)
So that you ensure that your entity has a heightmap type and placement type registered.
If modifying vanilla or another mod's spawn placements, you can use three operations:
REPLACE: checked first, the last mod to replace the predicate wipes out all other predicates. Listen with a low EventPriority
if you need to do this.
OR: checked second, only one of these predicates must pass along with the original predicate
AND: checked third, these predicates must all pass along with the original predicate
This event is not cancellable and does not
.
引用无效
have a result
Fired on the Mod bus IModBusEvent
.
-
嵌套类概要
嵌套类修饰符和类型类说明static class
static enum
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<T extends Entity>
voidregister
(EntityType<T> entityType, @Nullable SpawnPlacementType placementType, Heightmap.Types heightmap, SpawnPlacements.SpawnPredicate<T> predicate, RegisterSpawnPlacementsEvent.Operation operation) Register apredicate
for a givenentityType
andoperation
With the option of changing theplacementType
andheightmap
.<T extends Entity>
voidregister
(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate) Register an optional spawn placementpredicate
for a givenentityType
<T extends Entity>
voidregister
(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate, RegisterSpawnPlacementsEvent.Operation operation) Register apredicate
for a givenentityType
with a givenoperation
for handling
-
字段详细资料
-
map
-
-
构造器详细资料
-
RegisterSpawnPlacementsEvent
@Internal public RegisterSpawnPlacementsEvent(Map<EntityType<?>, RegisterSpawnPlacementsEvent.MergedSpawnPredicate<?>> map)
-
-
方法详细资料
-
register
public <T extends Entity> void register(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate) Register an optional spawn placementpredicate
for a givenentityType
-
register
public <T extends Entity> void register(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate, RegisterSpawnPlacementsEvent.Operation operation) Register apredicate
for a givenentityType
with a givenoperation
for handling -
register
public <T extends Entity> void register(EntityType<T> entityType, @Nullable @Nullable SpawnPlacementType placementType, @Nullable Heightmap.Types heightmap, SpawnPlacements.SpawnPredicate<T> predicate, RegisterSpawnPlacementsEvent.Operation operation) Register apredicate
for a givenentityType
andoperation
With the option of changing theplacementType
andheightmap
. These are only applied ifRegisterSpawnPlacementsEvent.Operation.REPLACE
is used. Usenull
for the placement or heightmap to leave them as is (which should be done in almost every case)
-