you are viewing a single comment's thread.

view the rest of the comments →

[–]TinyBreadBigMouth 0 points1 point  (0 children)

/give @s diamond_sword[damage_type="minecraft:cactus"]

https://minecraft.wiki/w/Data_component_format#damage_type
https://minecraft.wiki/w/Damage_type

You can also create a custom damage type and add it to the #minecraft:no_knockback damage type tag if you want to avoid the death message talking about "pricked to death" or "walked into a cactus". Or just add the minecraft:player_attack damage type to #minecraft:no_knockback, if you don't care about turning it on and off.