Topic category: Help with Minecraft modding (Java Edition)
Greetings everyone.
Recently, my friend wrote a command that gives you a sword that can damage and bypass creative mode's invulnerability.
Here's the command: /give @s diamond_sword[damage_type="generic_kill",attribute_modifiers=[{id:"attack_damage",type:"attack_damage",amount:13,operation:"add_multiplied_base",slot:"mainhand",display:{type:"hidden"}}]]
I taking a closer look, this command changes the damage type of the sword into "generic_kill"(which bypasses the creative mode's invulnerability)
I was wondering if I could somehow turn this into a procedure that makes it so that my custom sword possesses the attributes of the command above.
I'll be delighted if you guys can help me.
Thanks.
On item used/attacked whatever on the item trigger, if that doesn’t exist use the global trigger on entity attacked. Get that source entity and target entity are both players, get that target entity is in game mode creative, deal damage (sword damage) type generic
See if it works