New Loot Types Loot Effect - Tmtravlr/LootOverhaul GitHub Wiki

New Loot Types - Loot Effect

Structure:

Tag Type Description
Potion String The potion id to apply, like minecraft:speed. (Optional, either use this or PotionType)
PotionType String The potion type id to apply, like minecraft:long_swiftness. (Optional, either use this or Potion)
Entity String Selector for who should get the potion effect, like @p. Can be set by the Replace NBT function as well.
Duration Integer The duration of the potion in ticks (20 per second) (Optional, only used if Potion is set, defaults to 1)
Amplifier Integer The amplifier of the potion where 0 is level 1 (Optional, only used if Potion is set, defaults to 0)
Ambient Boolean If true, the potion effect will have faded particles (Optional, only used if Potion is set)
HideParticles Boolean If true, the potion effect will have no particles (Optional, only used if Potion is set)

Description:

This item will apply a potion effect as soon as it enters the world.

Example Usage: Giving the looter a health boost 2 effect for 60 seconds

 {
 	"type": "item",
 	"name": "lootoverhaul:loot_effect",
  	"weight": 1,
 	"functions": [
 		{
 			"function": "set_nbt",
 			"tag": "{Entity:\"#looter\", Potion:\"minecraft:health_boost\", Duration:1200, Amplifier:1}"
 		},
 		{
 			"function": "lootoverhaul:replace_nbt",
 			"replace": "#looter",
 			"target": "looter"
 		}
 	]
 }

Example Usage: Giving the looter a long swiftness effect (same as in the vanilla potion)

 {
 	"type": "item",
 	"name": "lootoverhaul:loot_effect",
  	"weight": 1,
 	"functions": [
 		{
 			"function": "set_nbt",
 			"tag": "{Entity:\"#looter\", PotionType:\"minecraft:long_swiftness\"}"
 		},
 		{
 			"function": "lootoverhaul:replace_nbt",
 			"replace": "#looter",
 			"target": "looter"
 		}
 	]
 }
Previous - Loot Command Back No Next
⚠️ **GitHub.com Fallback** ⚠️