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

public abstract class TriggerCondition extends Object
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 Details

  • Constructor Details

    • TriggerCondition

      public TriggerCondition()
  • Method Details

    • deepCopy

      @Nonnull public static TriggerCondition deepCopy(@Nonnull TriggerCondition condition)
    • deepCopyList

      @Nonnull public static List<TriggerCondition> deepCopyList(@Nonnull List<TriggerCondition> conditions)
    • getEventType

      @Nonnull public TriggerEventType getEventType()
    • setEventType

      public void setEventType(@Nonnull TriggerEventType eventType)
    • getEntry

      public int getEntry()
    • setEntry

      public void setEntry(int entry)
    • test

      public abstract boolean test(@Nonnull TriggerContext context)
      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 from onEntityExit(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 like Vector3d.rotateY(double). World-, entity-, and event-anchored fields must stay unchanged. volumeOrigin is the post-rotation volume origin, needed by block-grid conditions to rotate about the target cell center.
    • applyOnAccept

      public void applyOnAccept(@Nonnull TriggerContext context)
    • onEntityExit

      public void onEntityExit(@Nonnull UUID entityUuid)
      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.