Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format for enchants? #34

Open
wildstoats opened this issue Sep 23, 2022 · 0 comments
Open

Format for enchants? #34

wildstoats opened this issue Sep 23, 2022 · 0 comments

Comments

@wildstoats
Copy link

wildstoats commented Sep 23, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant