On Player Input
Triggers when a player performs a chosen input (jump, sprint, sneak, or movement keys).
字段
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
inputType | Optional<PlayerInputType> | — | If set, only triggers when this specific input is pressed.可选值:JUMPSPRINTSNEAKFORWARDBACKWARDLEFTRIGHT |
heldItem | Optional<Var<List<Item>>> | — | Require the player to be holding any of these items. |
TypeWriter 通用字段(triggers)
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
triggers | List<Ref<TriggerableEntry>> | empty | — |
How to use it
Without inputType the event fires on any input change. Set inputType (JUMP, SPRINT, SNEAK, FORWARD, BACKWARD, LEFT, RIGHT) to react to one key only, and heldItem to require one of the listed items in the player's hands.
The triggered entries can read the input from the interaction context (the pressed input and a true/false value per key), for example to branch a sequence.