#Help with detecting when a player breaks any block.

1 messages · Page 1 of 1 (latest)

frigid ermine
#

Good day! I'm making a custom enchantment that mines in 3x3. The problem is, I don't know how to detect when a player breaks a block fully, for any block. Any ideas?

wraith harnessBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1725099976:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

slender geyser
#

or which version are you on?

frigid ermine
#

i got the breaking mechanics working, but its using the "hit_block" effect on the custom enchant component. I only want it to proc when it fully breaks the block, not just hitting it

frigid ermine
slender geyser
frigid ermine
#

will the used.pickaxe scoreboard counts for mining using a pickaxe?

#

wait, this means that i have to manually add scoreboards for every tool?

slender geyser
flat sandal
#

Also that doesn't detect breaking blocks with a non-tool, like your hand

slender geyser
#

Anyway, he's using a pickaxe.

frigid ermine
#

thats fine, i only want it to detect the tools

#

ill try the advancement thing, that sounds like a good idea

slender geyser
#

I'm not sure, but it should work.

{
  "criteria": {
    "requirement": {
      "trigger": "minecraft:using_item",
      "conditions": {
        "item": {
          "predicates": {
            "minecraft:enchantments": [
              {
                "enchantments": "my:3x3"
              }
            ]
          }
        }
      }
    }
  }
}
frigid ermine
#

wait, this checks for the enchantment first and then the advancement

#

this is my 3x3 enchantment

#
{
    "description": {
        "text": "Oppenminer",
        "color": "#fc7816"
    },
    "supported_items": "#minecraft:enchantable/mining_loot",
    "weight": 1,
    "max_level": 1,
    "min_cost": {
        "base": 0,
        "per_level_above_first": 0
    },
    "max_cost": {
        "base": 0,
        "per_level_above_first": 0
    },
    "anvil_cost": 0,
    "slots": [
        "mainhand"
    ],
    "effects": {
        "minecraft:hit_block": [
            {
                "effect": {
                    "type": "minecraft:run_function",
                    "function": "ce:enchantment/oppenminer"
                }
            }
        ]
    }
}
#

cant i use the advancement instead to detect the block breaking? and have it in the requirements component in the enchantment?

#

so when the player breaks a block, the advancement triggers, then the custom enchantment procs?