Contents
Class EntityCountCondition
java.lang.Object
com.hypixel.hytale.builtin.triggervolumes.effect.TriggerCondition
com.hypixel.hytale.builtin.triggervolumes.effect.builtin.conditions.EntityCountCondition
Passes when the number of living NPCs currently inside the relevant volume(s) satisfies the
configured comparison. Corpses are excluded so that
EXACTLY 0 becomes true the moment the
last NPC dies, not when its corpse despawns.
The count comes from a direct query of the entity spatial index against each volume's shape, so it works regardless of the volume's configured target types (which only drive ENTER/TICK tracking).
When EntityType lists one or more role names, only NPCs whose role matches any of them are
counted; otherwise every living NPC is counted.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class TriggerCondition
BASE_CODEC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountEntities(TriggerContext context) static EntityCountConditioncreate(TriggerEventType eventType, EntityCountCondition.Comparison comparison, int count) booleanmatches(int entityCount) booleantest(TriggerContext context) Evaluates this condition for the supplied trigger context.Methods inherited from class TriggerCondition
applyOnAccept, deepCopy, deepCopyList, getEntry, getEventType, onEntityExit, rotateInPlace, setEntry, setEventType
-
Field Details
-
CODEC
-
-
Constructor Details
-
EntityCountCondition
public EntityCountCondition()
-
-
Method Details
-
create
@Nonnull public static EntityCountCondition create(@Nonnull TriggerEventType eventType, @Nonnull EntityCountCondition.Comparison comparison, int count) -
test
Description copied from class:TriggerConditionEvaluates this condition for the supplied trigger context. Most conditions should be side-effect-free; stateful conditions such as cooldowns should keep their own scoped state and clean it up fromTriggerCondition.onEntityExit(UUID)when needed.- Specified by:
testin classTriggerCondition
-
countEntities
-
matches
public boolean matches(int entityCount)
-