Mojira Archive
MC-277055

Functions not responsive to attacker entity enchant field

I am trying to make a custom wolf armor enchantment that increases damage, which that part works fine. I've got the wolf dealing extra damage. But what does not working is the calling of the function:

How to recreate: Create a custom enchantment that has wolf armor as the item enchanted, then tell it to run a function as a post-attack: (Might also not work outside of just wolf armor.)

I've also tested and my function with the exact name space works in game I was able to run it using /function I have attached the datapack, ignore the .DSStore files, they are harmless.

Here's my code:

{
"description":

{ "text": "Beastmaster", "color": "light_purple" }

,
"exclusive_set": "#minecraft:treasure",
"supported_items": "minecraft:wolf_armor",
"primary_items": "minecraft:book",
"weight": 5,
"max_level": 3,
"min_cost":

{ "base": 10, "per_level_above_first": 5 }

,
"max_cost":

{ "base": 20, "per_level_above_first": 25 }

,
"anvil_cost": 6,
"slots": [
"body"
],
"effects": {
"minecraft:attributes": [
{
"id": "attack_damage",
"attribute": "minecraft:attack_damage",
"amount":

{ "type": "minecraft:linear", "base": 2, "per_level_above_first": 1 }

,
"operation": "add_value"
}
],
"minecraft:post_attack": [
{
"enchanted": "attacker",
"affected": "victim",
"effect":

{ "type": "minecraft:run_function", "function": "prismatic_enchantments:enchants/beastmaster_particles" }

}
]
}
}

Awaiting Response

J. Micheal

2024-10-01, 06:05 PM

2024-10-12, 09:23 PM

2024-10-12, 09:23 PM

1

0

Unconfirmed

(Unassigned)

24w39a

-