Skip to content

cu_define_item_use en

mouse114514 edited this page Sep 12, 2026 · 1 revision

When Item Used

When Item Used

Overview

Defines the "use" behavior for a specific custom item. When the player uses that item, the connected blocks below run. Each item can have only one such behavior block.

This is the only kind of hat block that carries a slot: it has one item slot (ITEM) that selects which item this behavior belongs to.

Slots

Slot Type Description
ITEM Item slot The item this use behavior is bound to. Fill with a custom item or item value block

Connections

Connection Type Description
Top - hat block, cannot connect
Bottom Statement blocks that run when the player uses this item (eat, drink, talk, etc.)

Typical Uses

  • Custom food: restore hunger and gain weight on use
  • Custom medicine: heal or clear negative status on use
  • Custom tool: play a sound and consume the item on use

Generated Code

Emits a //ITEM_USE_ACTION:<itemID> … //END_ITEM_USE_ACTION section that binds the code to the item's useAction delegate.

Example

when customFood item used
├── eat hunger 15 weight gain 0.3
├── set happiness to player happiness + 5
└── talk "Delicious!"

Block ID: cu_define_item_use


中文 | Event Blocks | Block Reference

Clone this wiki locally