Contents
Class TriggerCondition
java.lang.Object
com.hypixel.hytale.builtin.triggervolumes.effect.TriggerCondition
- Direct Known Subclasses:
BlockTypeCondition, CooldownCondition, EntityCountCondition, GameModeCondition, ItemCondition, PermissionCondition, PlayerCountCondition, RandomChanceCondition, TagCondition, TimeOfDayCondition
Base class for trigger volume conditions. Conditions are AND-evaluated for the
current event type before an effect list is accepted; conditions whose event does not
match the current ENTER/TICK/EXIT event are ignored for that evaluation.
Implementing a new condition:
1. Extend this class and define a BuilderCodec that chains from BASE_CODEC
to inherit the Event field.
2. Register the codec through TriggerVolumesPlugin.registerConditionType().
3. Override test(TriggerContext) (and optionally onEntityExit(UUID)
for per-entity state cleanup).
The ticking system logs condition exceptions and treats them as failed conditions, so malformed content cannot accidentally force a volume to activate.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<TriggerCondition> static final CodecMapCodec<TriggerCondition> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyOnAccept(TriggerContext context) static TriggerConditiondeepCopy(TriggerCondition condition) static List<TriggerCondition> deepCopyList(List<TriggerCondition> conditions) intgetEntry()voidonEntityExit(UUID entityUuid) Called when an entity fully leaves the volume, even if this condition never passed during that stay.voidrotateInPlace(float yawRadians, org.joml.Vector3d volumeOrigin) Rotates volume-anchored offsets and facings when a prefab paste or world-gen placement applies a yaw to the owning volume.voidsetEntry(int entry) voidsetEventType(TriggerEventType eventType) abstract booleantest(TriggerContext context) Evaluates this condition for the supplied trigger context.
-
Field Details
-
CODEC
-
BASE_CODEC
-
-
Constructor Details
-
TriggerCondition
public TriggerCondition()
-
-
Method Details
-
deepCopy
-
deepCopyList
@Nonnull public static List<TriggerCondition> deepCopyList(@Nonnull List<TriggerCondition> conditions) -
getEventType
-
setEventType
-
getEntry
public int getEntry() -
setEntry
public void setEntry(int entry) -
test
Evaluates 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 fromonEntityExit(UUID)when needed. -
rotateInPlace
public void rotateInPlace(float yawRadians, @Nonnull org.joml.Vector3d volumeOrigin) Rotates volume-anchored offsets and facings when a prefab paste or world-gen placement applies a yaw to the owning volume. The yaw follows the entity transform convention: world offsets move likeVector3d.rotateY(double). World-, entity-, and event-anchored fields must stay unchanged.volumeOriginis the post-rotation volume origin, needed by block-grid conditions to rotate about the target cell center. -
applyOnAccept
-
onEntityExit
Called when an entity fully leaves the volume, even if this condition never passed during that stay. Override to release per-entity state held by stateful conditions.
-