Items can be "used" in many different ways in many different contexts. Each item can have multiple defined item use action sequences.
An item use action sequence is a collection of item use actions that are performed one after another. If one of the actions in the sequence can't be performed, the sequence can't be performed. If one of the actions fails during execution, the sequence stops.
On an item with multiple use action sequences, when attempting to use the item sequences that can't be performed will be ignored and will proceed to the next sequence to attempt.
A use action is a simple modular action that performs something. A use action can't be used on its own, it must be part of a use action sequence. Chaining multiple actions together into sequences can create complex, reusable behavior.
Each item use action sequence has a set of context flags which defines where and how the sequence is triggered. Each sequence can define as many flags as deemed appropriate, and multiple values can be active at the same time.
The context flag values defined in SurvivEngine are:
Context Menu
This use action sequence will appear and can be triggered from within the right-click context menu of the inventory screen
Selected
This use action will be performed when the item becomes the selected item in the player's hotbar
World
This use action will be performed when it is the held item in the player's hand and the "Use" input occurs (default: right click)