Started by
vlonabuser
on
Topic category: Help with Minecraft modding (Java Edition)
I made a computer that can play any record in the game and i have a mob that i want to vibe when i turn music on. I tried to do it that way: when computer plays music it changes its "music" logic nbt to true, i dont know how to optimise scanning blocks so i js made it so every tick my mob checks if block at x+/- random 1:6 y +/- random 1:6 has "music" logic nbt set to true, if it is, it changes his data logic "vibe" to true and it should play animation and override its motion vector to 0 cuz i dont know how to stop it from walking any other way. Somehow it crashes the game with "/ 0" java exception. Pls help
can you show the procedure?
i dont know how to show it its too big, is there a way i can send you full mod so you can take a better look cuz i think i messed up somewhere else
I'd prefer you just send the procedure(s) that are relevant, you can send them as procedure files,
https://drive.google.com/file/d/1c5QkzyWo12Hr2GgbDAh3nRbwMPic_k1g/view?usp=sharing
it works but not how i wanted it to, computer should make blocks under it (in 7*7 radius) have "music" nbt tag set to true, make global var musicplaying to true and set vars musicx y and z to its location. now there is another problem, i dont know why nbt tags work only with custom blocks so i had to make one, if musicplaying is true it sets nbt tag "music" to true so it works. only problem is its still not working like piglins and there is no easy way to check or set something in radius so i think this is not the most optimal way to implement my idea, i think you are more skilled in this than me so pls give me some tips
the reason why you can't set some block's nbt is because they have to be block entities. You should be able to set the nbt of fx. a chest or a furnace.
you can check for entities in a radius with this,