Topic category: Help with Minecraft modding (Java Edition)
I am creating a mod that adds an entity that i want to be able to crouch to get under smaller spaces. I already asked about this, and someone gave a good procedure. Here it is.
Overall, it works well, but there is one problem. So as you can see, it will shrink its hitbox if it detects a solid block 2 blocks in front of it, then it will make it back to normal, and that's the problem. when it shrinks it's hitbox and it's under a space that's smaller than it's original hitbox, it suffocates itself for a tick or so, because it rapidly changes between smaller and normal. So if it's under there long enough, it will die. So would anyone know how i could change so that it stays smaller until it doesn't detect a solid block? Or do you know a better procedure or way to do this? Please leave a detailed explanation, as i suck at modding. And please leave a picture of what it should look like if you can.
also, if you see the little unloaded image icon, just right click on it and left click "open image in new tab", and you should see it.
Thank you in advance!
Run a check for if block at x y+1 z is air, if not then return 0.6, otherwise return 1
@fr6_17 something like this?
It needs to have the x and z +2 so than it can detect the block in front of it, otherwise it can only become smaller if it's under the cieling, which isn't possible unless i spawn it.
i tried it, and it he still switches back and forth. Could you explain a little more, or did i do something wrong?
Well the second procedure image you got there is basically the same. So I dont know what you did, but either of these should work:
Also Is this procedure on tick cause if not then that might be the cause of it switching back and forth.
Also try changing outline to visual