
Format for enchants?
wildstoats opened this issue ยท 0 comments
Hello there. Either enchants aren't working quite right or I'm misunderstanding something. When I try to use the example from breakevents.json
:
[
{
"playerhelditem": {
"item": "minecraft:iron_pickaxe",
"nbt": [
{
"tag": "ench",
"contains": [
{
"tag": "id",
"value": 34
}
]
}
]
},
"block": "minecraft:diamond_ore",
"result": "allow"
},
{
"block": "minecraft:diamond_ore",
"message": "You cannot mine this!",
"result": "deny"
}
]
And then give myself an Iron Pickaxe with Piercing (id:34) using the following command:
/give @s iron_pickaxe{Enchantments:[{id:piercing,lvl:3}]} 1
I am unable to break the block due to Rule 1.
If I instead do this:
/give @s iron_pickaxe{ench:[{id:34,lvl:3}]} 1
Then I am able to break the block but AFAIK this isn't a valid enchant. If I mouse over the pickaxe it glimmers as if it's enchanted but doesn't report as Piercing III
.
If I change the rules to the following:
[
{
"playerhelditem": {
"item": "minecraft:iron_pickaxe",
"nbt": [
{
"tag": "Enchantments",
"contains": [
{
"tag": "id",
"value": "piercing"
}
]
}
]
},
"block": "minecraft:diamond_ore",
"result": "allow"
},
{
"block": "minecraft:diamond_ore",
"message": "You cannot mine this!",
"result": "deny"
}
]
Then the rules work as expected but fxcontrol
shows the following error message in the game console:
FxControl Error: Bad expression 'piercing'!
Does this just need updated to allow for string tags as opposed to numeric values? I am using fxcontrol-1.18-3.0.0.jar
on minecraft 1.18.1
.