Class CommandAttachment
java.lang.Object
de.luckymcdev.foundryengine.common.cutscene.model.CutsceneAttachment
de.luckymcdev.foundryengine.common.cutscene.model.CommandAttachment
Attachment for executing server commands at a specific point in the cutscene.
Commands are executed on the server with appropriate permission checks.
-
Field Summary
FieldsFields inherited from class CutsceneAttachment
at, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of this attachment.static CommandAttachmentfromNbt(net.minecraft.nbt.CompoundTag tag) floatgetDelay()Returns a display name for this attachment (for UI).floatReturns the total normalized duration of this attachment (0..1), or 0 if it's instantaneous.floatReturns the effective trigger time (at + delay) in normalized form.intgetTriggerTick(float cutsceneLength) Returns the effective trigger tick based on cutscene length.voidsetCommand(String command) voidsetDelay(float delay) net.minecraft.nbt.CompoundTagtoNbt()Serializes this attachment to NBT for saving.Methods inherited from class CutsceneAttachment
getAt, getType, setAt
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
CommandAttachment
-
-
Method Details
-
fromNbt
-
toNbt
public net.minecraft.nbt.CompoundTag toNbt()Description copied from class:CutsceneAttachmentSerializes this attachment to NBT for saving. Subclasses should override this to add their specific data.- Overrides:
toNbtin classCutsceneAttachment
-
copy
Description copied from class:CutsceneAttachmentCreates a copy of this attachment. Subclasses must implement this properly.- Specified by:
copyin classCutsceneAttachment
-
getDisplayName
Description copied from class:CutsceneAttachmentReturns a display name for this attachment (for UI).- Specified by:
getDisplayNamein classCutsceneAttachment
-
getDuration
public float getDuration()Description copied from class:CutsceneAttachmentReturns the total normalized duration of this attachment (0..1), or 0 if it's instantaneous.- Specified by:
getDurationin classCutsceneAttachment
-
getCommand
-
setCommand
-
getDelay
public float getDelay() -
setDelay
public void setDelay(float delay) -
getEffectiveAt
public float getEffectiveAt()Returns the effective trigger time (at + delay) in normalized form. -
getTriggerTick
public int getTriggerTick(float cutsceneLength) Returns the effective trigger tick based on cutscene length.
-