#Help with detecting when a player breaks any block.
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 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
custom enchantment on 1.21?
or which version are you on?
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
yes, custom enchantment on 1.21.1
Well, it can't be done simply. you need to summon markers at the position of the blocks, bind them to the player using the id system, and make an effect when the player used a pickaxe and then break blocks from the position of the markers. so you will need to make additional checks, if another player breaks the block, then kill the marker and may provide for other cases.
will the used.pickaxe scoreboard counts for mining using a pickaxe?
wait, this means that i have to manually add scoreboards for every tool?
no, scoreboard does not count if the pickaxe is not damaged (for example, with a unbreaking).
You need to use advancement with using_item trigger
Also that doesn't detect breaking blocks with a non-tool, like your hand
Anyway, he's using a pickaxe.
thats fine, i only want it to detect the tools
ill try the advancement thing, that sounds like a good idea
you need to check the enchantment instead of the tool
I'm not sure, but it should work.
{
"criteria": {
"requirement": {
"trigger": "minecraft:using_item",
"conditions": {
"item": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "my:3x3"
}
]
}
}
}
}
}
}
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?
you can't