Started by
Fresfries
on
Topic category: Help with Minecraft modding (Java Edition)
I created an item that gets damaged every time you interact with a slot of a open gui.
Im stuck on making the item break.
I got it so far that every time you interact with a slot it damages the item by 1 and if it reaches max. damage it just disappears, no sound, no particles.
Is there a way to just break the item after 1 durability because the playsound also doesn't work for me.
(this playsound block doesn't play the sound & also makes the code stop working, not matter if I leave it at x, y, z or not).
I don't think you need Position of event target entity
with X Y Z you should be good
I've tried that first, still it breaks the code & doesn't play the sound.
Can I not just make the item break, that would make things easier?
This is the full code, if it helps.
yeah by dealing the whole damage of the item. it should play the sound automatically when it breaks if it's a tool
oh wait it can be any item?
if yes,
deal 1 damage to item in main hand of event target entity
if get damage from item in main hand of event target entity = max possible damage of item in main hand of event target entity
do play at x y z sound: Item.Break
Maybe it's a bug because I'm using version 2021.3
I found a work-around by playing a sound by executing a command, not the cleanest way but it'll have to do for now.