Class TriggerContext

java.lang.Object
com.hypixel.hytale.builtin.triggervolumes.effect.TriggerContext

public class TriggerContext extends Object
  • Constructor Details

  • Method Details

    • getEntityRef

      @Nullable public Ref<EntityStore> getEntityRef()
    • getActorPosition

      @Nullable public org.joml.Vector3d getActorPosition()
      Position of the triggering actor: the live transform when the ref is still valid, otherwise the snapshot captured when the effect was scheduled (so position-based effects still fire at the right place after the actor, e.g. a projectile, has despawned). Null when neither is available.
    • getStore

      @Nonnull public Store<EntityStore> getStore()
    • getEventType

      @Nonnull public TriggerEventType getEventType()
    • getVolume

      @Nonnull public VolumeEntry getVolume()
    • getSpatialVolumes

      @Nonnull public List<VolumeEntry> getSpatialVolumes()
      Volumes used for spatial queries (shape, bounds). For group effects this is every member volume; otherwise it is a single-element list of getVolume().
    • getSignalTags

      @Nonnull public List<SignalTag> getSignalTags()
      Tags carried by the signal that produced this context (empty for non-signal events). A TagCondition with Source: EVENT matches against these.
    • getBlockPosition

      @Nullable public org.joml.Vector3d getBlockPosition()
    • getEventPosition

      @Nullable public org.joml.Vector3d getEventPosition()
      Where the triggering event happened: the block position for block-driven events, otherwise the actor position. Used to anchor a signal at its origin so receiver effects fire there rather than at the receiving volume's center. Null when the event carries no position.
    • getBlockId

      @Nullable public String getBlockId()
    • getInteractionType

      @Nullable public InteractionType getInteractionType()
    • resolveOrigin

      @Nullable public org.joml.Vector3d resolveOrigin(@Nonnull EffectOrigin origin, @Nullable org.joml.Vector3d offset, @Nonnull TriggerContext.MissingActor onMissing)
      Resolves the world position an effect should act at for the given anchor, adding offset (which is the absolute position itself for EffectOrigin.WORLD_ABSOLUTE). Returns null only when an ENTITY/EVENT anchor has no position and onMissing is TriggerContext.MissingActor.SKIP.