Item Effects

Tetra provides a set of predefined item effects that can be used, but it's also possible to create your own item effects either by implementing them (in an addon) or by using the datadriven item effect system.

A list of the predefined item effects can be found here.

Data driven item effects

Item effects can be defined in JSON files within data/tetra/item_effects/ in your datapack.

Item effect

A definition of a datadriven item effect, an effect is a combination of a trigger, a condition and an outcome. The trigger determines when the effect occurs and what data is available to the effect. The condition determines if the effect should be executed, and the outcome determines what actually happens.

Format:
triggerResource location

The trigger determines when the effect occurs and what data is available to the effect. Available triggers can be found here: https://tetra.mickelus.se/wiki/tech/item-effects/triggers

effectstring

The string representation for this effect, if this is present on the item used for the trigger this effect will be executed.

dataoptional
numbersoptional
map[
string
:
Number provider
]
vectorsoptional
map[
string
:
Vector provider
]
entitiesoptional
map[
string
:
Enitity provider
]

Allows data to be defined and made available across the entire effect instance. Data providers can be called directly in conditions and outcomes, but setting up data here may allow for improved performance and readability.

conditionoptionalItem effect condition

Determines if the effect outcome should be executed, can be omitted if the outcome should always execute.

outcomeItem effect outcome

Determines what actually happens when the effect is triggered.