Contents
Class TriggerEffect
java.lang.Object
com.hypixel.hytale.builtin.triggervolumes.effect.TriggerEffect
- Direct Known Subclasses:
CancelParticlesEffect, ClearRespawnPointsEffect, ControlDoorsEffect, DamageEntityEffect, EntityEffectEffect, GiveItemEffect, ModifyTagsEffect, PastePrefabEffect, PlaceBlockEffect, PlayAnimationEffect, PlaySoundEffect, PlayVfxEffect, RemoveEntitiesEffect, ReplaceBlockTypeEffect, RunRootInteractionEffect, SendMessageEffect, SendSignalEffect, SetGameModeEffect, SetMusicEffect, SetRespawnPointEffect, SetVelocityEffect, SetWeatherEffect, SetWorldSpawnEffect, ShowEventTitleEffect, SpawnNpcEffect, TeleportEffect, TimeEffect, TriggerNpcMarkersEffect, VolumeStateEffect
Base class for trigger volume effects. Subclasses define behavior that runs
when entities enter, tick inside, or exit a trigger volume.
Implementing a new effect:
1. Extend this class and define a BuilderCodec that chains from BASE_CODEC (inherits Event and Interval).
2. Register the codec in TriggerVolumesPlugin.registerEffectTypes() via
TriggerEffect.CODEC.register("MyType", MyEffect.class, MyEffect.CODEC).
3. Override execute() (and optionally onEntityExit()).
Field initialization constraints:
- All codec fields are optional — missing keys decode to null for reference types and JVM defaults for primitives.
- Reference-type fields (Vector3d, String, etc.) should be initialized to a sensible non-null default.
The effect editor UI displays zeros/empty for unset fields but does not write them to the object unless
the user interacts with the input, so a null field will be silently omitted when the effect is saved to disk.
- execute() must null-guard any reference field that could still be null after deserialization
(e.g. from hand-edited JSON missing the key).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<TriggerEffect> static final CodecMapCodec<TriggerEffect> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TriggerEffectdeepCopy(TriggerEffect effect) static List<TriggerEffect> deepCopyList(List<TriggerEffect> effects) abstract voidexecute(TriggerContext context) floatgetDelay()intgetEntry()floatvoidonEntityExit(UUID entityUuid) 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.voidsetDelay(float delay) voidsetEntry(int entry) voidsetEventType(TriggerEventType eventType) voidsetInterval(float interval)
-
Field Details
-
CODEC
-
BASE_CODEC
-
-
Constructor Details
-
TriggerEffect
public TriggerEffect()
-
-
Method Details
-
deepCopy
-
deepCopyList
-
getEventType
-
setEventType
-
getInterval
public float getInterval() -
setInterval
public void setInterval(float interval) -
getDelay
public float getDelay() -
setDelay
public void setDelay(float delay) -
getEntry
public int getEntry() -
setEntry
public void setEntry(int entry) -
execute
-
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 effects to rotate about the target cell center. -
onEntityExit
-