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:{
"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:{
"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:{
"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:{
"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:{
"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: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'.
{
"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:The bounding box to search within. Format: [ x1, y1, z1, x2, y2, z2 ]
{
"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:The bounding box to search within. Format: [ x1, y1, z1, x2, y2, z2 ]
{
"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:{
"type": "tetra:function",
"function": "tetra:test",
"position": "miner"
}
Imitate item effect outcome
Attempts to imitate some effect from another item
Format: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.
{
"type": "tetra:imitate",
"imitate": "tp @s ~ ~2 ~",
"entity": "attacker",
"position": "target"
}
Loop item effect outcome
Applies the given outcome several times
Format:If set the index in the loop will be added to the context using this key.
{
"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:{
"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:{
"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:{
"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:{
"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:{
"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:{
"type": "tetra:sound",
"sound": "minecraft:block.anvil.break",
"position": "target"
}