Generic Kill damage type on a sword

Started by RetroContra on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Generic Kill damage type on a sword

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.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
On item used/attacked…
Mon, 06/08/2026 - 20:09

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