Skip to main content
 Warning: Beta Version
Version: Beta ⚠️

ActionEntry

The ActionEntry defines an action to take. When it is triggered, it will run it's execute method. After which it will trigger all the next entries in the chain.

 Immutable Entry

It is important to stress that the entry must be immutable. It cannot have any mutable state.

Usage

ExampleActionEntry.kt
@Entry("example_action", "An example action entry.", Colors.RED, "material-symbols:touch-app-rounded")
class ExampleActionEntry(
override val id: String = "",
override val name: String = "",
override val criteria: List<Criteria> = emptyList(),
override val modifiers: List<Modifier> = emptyList(),
override val triggers: List<Ref<TriggerableEntry>> = emptyList(),
) : ActionEntry {
override fun execute(player: Player) {
super.execute(player) // This will apply all the modifiers.
// Do something with the player
}
}

Typewriter will automatically trigger the next entries in the chain after the execute method is called. If you want to call the next entries in the chain manually, you can should the CustomTriggeringActionEntry.