Package net.minecraftforge.event.entity
Class SpawnPlacementRegisterEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.SpawnPlacementRegisterEvent
- All Implemented Interfaces:
- IModBusEvent
public class SpawnPlacementRegisterEvent
extends net.minecraftforge.eventbus.api.Event
implements 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, SpawnPlacements.Type, 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.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic enumNested 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 Map<EntityType<?>,SpawnPlacementRegisterEvent.MergedSpawnPredicate<?>> 
- 
Constructor SummaryConstructorsConstructorDescriptionSpawnPlacementRegisterEvent(Map<EntityType<?>, SpawnPlacementRegisterEvent.MergedSpawnPredicate<?>> map) 
- 
Method SummaryModifier and TypeMethodDescription<T extends Entity>
 voidregister(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate) Register an optional spawn placementpredicatefor a givenentityType<T extends Entity>
 voidregister(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate, SpawnPlacementRegisterEvent.Operation operation) Register apredicatefor a givenentityTypewith a givenoperationfor handling<T extends Entity>
 voidregister(EntityType<T> entityType, SpawnPlacements.Type placementType, Heightmap.Types heightmap, SpawnPlacements.SpawnPredicate<T> predicate, SpawnPlacementRegisterEvent.Operation operation) Register apredicatefor a givenentityTypeandoperationWith the option of changing theplacementTypeandheightmap.Methods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
map
 
- 
- 
Constructor Details- 
SpawnPlacementRegisterEvent@Internal public SpawnPlacementRegisterEvent(Map<EntityType<?>, SpawnPlacementRegisterEvent.MergedSpawnPredicate<?>> map) 
 
- 
- 
Method Details- 
registerpublic <T extends Entity> void register(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate) Register an optional spawn placementpredicatefor a givenentityType
- 
registerpublic <T extends Entity> void register(EntityType<T> entityType, SpawnPlacements.SpawnPredicate<T> predicate, SpawnPlacementRegisterEvent.Operation operation) Register apredicatefor a givenentityTypewith a givenoperationfor handling
- 
registerpublic <T extends Entity> void register(EntityType<T> entityType, @Nullable SpawnPlacements.Type placementType, @Nullable Heightmap.Types heightmap, SpawnPlacements.SpawnPredicate<T> predicate, SpawnPlacementRegisterEvent.Operation operation) Register apredicatefor a givenentityTypeandoperationWith the option of changing theplacementTypeandheightmap. These are only applied ifSpawnPlacementRegisterEvent.Operation.REPLACEis used. Usenullfor the placement or heightmap to leave them as is (which should be done in almost every case)
 
-