Item effect outcome

Item effect outcomes are used to do things in the world when an item effect triggers

Apply effect item effect outcome

Applies a mob (potion) effect on the provided entity.

Format:
typetetra:apply_effect
effectResource location

A resource location referencing a mob effect. Vanilla effects can be found here: https://minecraft.wiki/w/Effect

entityEnitity provider

The entity that the effect should be applied to.

sourceoptionalEnitity provider

The entity that the effect should be applied from. Probably relevant in cases where a mob effect would kill a player, and this source entity would be used for the kill message.

durationNumber provider

The duration of the effect, in ticks.

amplifierNumber provider

The amplifier of the effect, a higher value typically makes the mob effect stronger. Starts at 0 for most effects.

stackDurationCapoptionalNumber provider

If provided, when this outcome is triggered and 'entity' already has the mob effect active then the effect duration will be increased by 'duration' amount up to this cap.

stackAmplifierCapoptionalNumber provider

If provided, when this outcome is triggered and 'entity' already has the mob effect active then the effect amplifier will be increased by 'amplifier' amount up to this cap.

ambientoptionalItem effect condition

Denotes that the effect is an ambient effect in the world. Usually true for beacon effects, likely not be true for an item effect.

visibleoptionalItem effect condition

Determines if particle effects should appear around the entity while the effect is active.

showIconoptionalItem effect condition

Determines if the effect icon should appear in the player's UI while the effect is active.

Example:
{
  "type": "tetra:apply_effect",
  "effect": "minecraft:regeneration",
  "entity": "killer",
  "source": "killer",
  "duration": 40,
  "amplifier": 1,
  "stackDurationCap": 200
}

Break block item effect outcome

Attempts to break a block at the given position. The breaker field is used to determine which entity is breaking the block. The harvest condition determines if the block should drop loot.

Format:
typetetra:break_block
positionVector provider

The position of the block to break

breakerEnitity provider

The entity that should count as the breaker of the block, possibly affecting statistics, loot drops, and other effects and mods.

harvestoptionalItem effect condition

Set to true to cause the block to drop loot. Defaults to false.

Example:
{
  "type": "tetra:break_block",
  "position": {
    "type": "tetra:expression",
    "result": [
      "targetX",
      "targetY+1",
      "targetZ"
    ]
  },
  "breaker": "breaker",
  "harvest": true
}

Command item effect outcome

Executes the given command, see docs for commands: https://minecraft.wiki/w/Commands.

Format:
typetetra:command
commandstring

A standard minecraft command.

positionVector provider

The position to execute the command at, ~ coordinate values will be based on this value. Possibly optional depending on the command.

entityoptionalEnitity provider

The @s target selector will reference this entity.

Example:
{
  "type": "tetra:command",
  "command": "tp @s ~ ~2 ~",
  "entity": "attacker",
  "position": "target"
}

Conditioned item effect outcome

Applies the given outcome if the given condition is met.

Format:
typetetra:conditioned
conditionItem effect condition

If this condition passes then the outcome will be applied.

outcomeItem effect outcome

The outcome to apply if the condition passes.

Example:
{
  "type": "tetra:conditioned",
  "condition": {
    "type": "tetra:random",
    "chance": 0.5
  },
  "outcome": {
    "type": "tetra:apply_effect",
    "effect": "minecraft:regeneration",
    "entity": "miner",
    "source": "miner",
    "duration": 20,
    "amplifier": 1
  }
}

Damage entity item effect outcome

Attempts to damage the given entity. Keep in mind that this would be a different damage instance from a triggering attack and it will be affected by invulnerability frames.

Format:
typetetra:damage_entity
entityEnitity provider

The entity to damage

amountNumber provider

The amount of damage to deal, can be a decimal value

damageTypeResource location

A resource location referencing a damage type, the damage type has significant impact on how the damage is dealt. Datapacks can define their own damage types. More info on damage types here: https://minecraft.wiki/w/Damage_type

Example:
{
  "type": "tetra:damage_entity",
  "entity": "breaker",
  "amount": 1,
  "damageType": "minecraft:generic"
}

Delay item effect outcome

Applies the given outcome after the given delay (in ticks). Can be keyed (both globally and to an entity) to have the delayed outcome either replace or get blocked with previous (active) delays sharing the key.

Format:
typetetra:delay
outcomeItem effect outcome

The outcome to apply after the delay

delayNumber provider

The delay in ticks before the outcome is to be applied

keyoptionalstring

Providing a key will make the delay keyed, meaning it will replace or get blocked with previous (active) delays sharing the key depending on the value of 'replaceKey'.

keyEntityoptionalEnitity provider

Providing this will make the key-ing functionality described above scoped for the specified entity, rather than the key being shared globally.

replaceKeyoptionalItem effect condition

If true (and 'key' or 'keyEntity' is provided), the delayed outcome will replace any previous (active) delays sharing the key. If false, the delayed outcome will get blocked by any previous (active) delays sharing the key. Defaults to true.

Example:
{
  "type": "tetra:delay",
  "delay": 2,
  "outcome": {
    "type": "tetra:apply_effect",
    "effect": "minecraft:regeneration",
    "entity": "miner",
    "source": "miner",
    "duration": 20,
    "amplifier": 1
  }
}

Find blocks item effect outcome

Finds all blocks matching the given condition in the given bounding box and runs the given outcome for each of them, originating from the given position. Adds a 'ref' vector, an 'index' number and a 'successCount' number to the context for the outcome.

Format:
typetetra:find_blocks
originVector provider

The position that the search will originate from.

bounds
array[
number
]

The bounding box to search within. Format: [ x1, y1, z1, x2, y2, z2 ]

conditionoptionalProperty matcher

The given outcome will be run for all blocks that match this condition.

outcomeItem effect outcome

This outcome will be run for each block that matches the condition. A 'ref' vector (holds the position of the block), an 'index' number and a 'successCount' number will be added to the context for the outcome.

Example:
{
  "type": "tetra:find_blocks",
  "origin": "target",
  "bounds": [
    -5,
    -2,
    -5,
    5,
    2,
    5
  ],
  "condition": {
    "tag": "tetra:nailed"
  },
  "outcome": {
    "type": "tetra:break_block",
    "position": "ref",
    "breaker": "breaker",
    "harvest": true
  }
}

Find entities item effect outcome

Finds all entities matching the given condition in the given bounding box and runs the given outcome for each of them, originating from the given position. Adds a 'ref' entity, an 'index' number and a 'successCount' number to the context for the outcome.

Format:
typetetra:find_entities
originVector provider

The position that the search will originate from.

bounds
array[
number
]

The bounding box to search within. Format: [ x1, y1, z1, x2, y2, z2 ]

conditionoptionalEntity predicate

The given outcome will be run for all entities that match this condition.

outcomeItem effect outcome

this outcome will run for each entity that matches the condition. A 'ref' entity (referencing the entity this outcome is run for), an 'index' number and a 'successCount' number will be added to the context for the outcome.

excludeoptional
array[
Enitity provider
]

Entities listed in this array will be excluded from the search.

Example:
{
  "type": "tetra:find_entities",
  "origin": "target",
  "bounds": [
    -5,
    -2,
    -5,
    5,
    2,
    5
  ],
  "condition": {
    "type": "#minecraft:freeze_hurts_extra_types"
  },
  "exclude": [
    "attacker"
  ],
  "outcome": {
    "type": "tetra:apply_effect",
    "effect": "minecraft:slowness",
    "entity": "ref",
    "source": "attacker",
    "duration": 60,
    "amplifier": 1
  }
}

Function item effect outcome

Executes a function (based on the given resource location), see docs: https://minecraft.wiki/w/Function_(Java_Edition)

Format:
typetetra:function
functionResource location

A resource location referencing the function to execute.

positionVector provider

The position to execute the function at, ~ coordinate values will be based on this value. Possibly optional depending on the function.

entityoptionalEnitity provider

The @s target selector will reference this entity.

Example:
{
  "type": "tetra:function",
  "function": "tetra:test",
  "position": "miner"
}

Imitate item effect outcome

Attempts to imitate some effect from another item

Format:
typetetra:imitate
itemStackItemStack

The item stack from which an effect will be imitated.

effectstring
Allowed values:
swing
leftClickEntity
hurtEnemy
breakBlockStart
mineBlock
finishUsing

Values: "swing": called when a entity tries to play the 'swing' animation, "leftClickEntity": called when the player Left Clicks (attacks) an entity, processed before damage is done, "hurtEnemy": called after the item has been used to attack an entity, "breakBlockStart": called before a block is broken, "mineBlock": called when a Block is destroyed using this ItemStack, "finishUsing": called when the item in use count reach 0, e.g. item food eaten.

userEnitity provider

The entity performing the effect.

targetEntityoptionalEnitity provider

The target that the effect will be performed on, required for swing, leftClickEntity, hurtEnemy.

targetPositionoptionalVector provider

The target position that the effect will be performed at, required for breakBlockStart and mineBlock.

Example:
{
  "type": "tetra:imitate",
  "imitate": "tp @s ~ ~2 ~",
  "entity": "attacker",
  "position": "target"
}

Loop item effect outcome

Applies the given outcome several times

Format:
typetetra:loop
outcomeItem effect outcome

This outcome will be run 'count' times.

countNumber provider

The number of times to run the outcome.

indexKeyoptionalstring

If set the index in the loop will be added to the context using this key.

breakConditionoptionalItem effect condition

Checked after each iteration if present, the loop breaks if the condition passes.

Example:
{
  "type": "tetra:loop",
  "outcome": {
    "type": "tetra:apply_effect",
    "effect": "minecraft:regeneration",
    "entity": "miner",
    "source": "miner",
    "duration": "20*(1+i)",
    "amplifier": 1,
    "stackDurationCap": 400
  },
  "count": {
    "type": "tetra:random",
    "min": 1,
    "max": 5
  },
  "indexKey": "i"
}

Move entity item effect outcome

Attempts to move the given entity to the given.

Format:
typetetra:move_entity
entityEnitity provider

The entity that is to be moved.

positionVector provider

The position to move the entity to.

Example:
{
  "type": "tetra:move_entity",
  "position": {
    "type": "tetra:expression",
    "result": [
      "targetX",
      "targetY+1",
      "targetZ"
    ]
  },
  "entity": "breaker"
}

Multiple item effect outcome

Applies multiple outcomes. All outcomes are applied unless the 'count' field is specified.

Format:
typetetra:multiple
outcomes
array[
Item effect outcome
]

Outcomes in this array will be applied, which outcomes are applied depends on other fields of this outcome.

countoptionalNumber provider

The number of outcomes to apply. If not specified or if there are fewer outcomes than count, all outcomes are applied.

randomoptionalItem effect condition

If true, the outcomes are applied in a random order. Less useful when count is not present.

onlyCountSuccessfuloptionalItem effect condition

If true, only the outcomes that successfully apply are counted towards the 'count' limit.

failureLimitoptionalNumber provider

If provided, stops executing outcomes when the number of failed outcomes has reached this limit.

Example:
{
  "type": "tetra:multiple",
  "outcomes": [
    {
      "type": "tetra:apply_effect",
      "effect": "minecraft:regeneration",
      "entity": "miner",
      "source": "miner",
      "duration": 20,
      "amplifier": 1
    },
    {
      "type": "tetra:apply_effect",
      "effect": "tetra:bleeding",
      "entity": "miner",
      "source": "miner",
      "duration": 20,
      "amplifier": 1
    }
  ],
  "count": 1,
  "random": true
}

Particle item effect outcome

Spawns a particle in the world using the given parameters. Some of the parameters may have different effects depending on the particle type.

Format:
typetetra:particle
particleParticle

A particle definition, most particles only require the 'type' field.

positionVector provider

The position to spawn the particle at.

countNumber provider

The number of particles to spawn.

speedNumber provider

The initial speed of the particles, effect tends to vary depending on particle type.

spreadVector provider

A vector typically defining a space of allowed difference in initial particle speed, effects tends to vary depending on particle type.

Example:
{
  "type": "tetra:particle",
  "particle": {
    "type": "minecraft:poof"
  },
  "position": {
    "type": "tetra:entity_position",
    "entity": "target",
    "origin": "center"
  },
  "count": 12,
  "speed": 0.1,
  "spread": [
    1,
    0,
    1
  ]
}

Push entity item effect outcome

Attempts to push the given entity in the given direction

Format:
typetetra:push_entity
vectorVector provider

The direction that the entity should be pushed in, the length of the vector effectively decides the strength of the push.

entityEnitity provider

The entity that should be pushed.

Example:
{
  "type": "tetra:push_entity",
  "vector": {
    "vectors": {
      "facing": {
        "type": "tetra:entity_facing",
        "entity": "attacker"
      }
    },
    "type": "tetra:expression",
    "result": [
      "facingX * 0.2",
      1,
      "facingZ * 0.2"
    ]
  },
  "entity": "target"
}

Set block item effect outcome

Set the block at the given position to the given blockstate

Format:
typetetra:set_block
positionVector provider

The position in the world at which the block will be set.

blockBlockstate

A blockstate definition, the block in the world at the given position will be set to this.

Example:
{
  "type": "tetra:set_block",
  "position": {
    "type": "tetra:expression",
    "result": [
      "targetX",
      "targetY+1",
      "targetZ"
    ]
  },
  "block": {
    "Name": "minecraft:beetroots",
    "Properties": {
      "age": "0"
    }
  }
}

Sound item effect outcome

Plays a sound in the world using the given parameters

Format:
typetetra:sound
soundResource location

A resource location referencing a sound (haven't found a list of all sounds, but you can use the /playsound command to explore what's available).

positionVector provider

The position in the world where the sound should be played.

volumeoptionalNumber provider

The volume of the sound. 1.0 is full volume, 0.0 is silent. Defaults to 1.0.

pitchoptionalNumber provider

The pitch of the sound. 1.0 is normal pitch, 2.0 is double pitch, 0.5 is half pitch. Defaults to 1.0.

Example:
{
  "type": "tetra:sound",
  "sound": "minecraft:block.anvil.break",
  "position": "target"
}