Topic category: Help with Minecraft modding (Java Edition)
So, I'm tryna make a potion effect that makes the player/mob completely immobile for a few minutes/seconds but I'm not sure how to get it to work. Yes, yes, i know you can add slowness with a high amplifier, but I don't want the player to see a slowness effect, I want it to seem like its own status effect. How can I use procedures to make the entity be unable to move? Or maybe, be able to add slowness but doesn't appear by the inventory? And maybe if we can go the extra mile, add an overlay on the mob texture to make them blue like they're stuck in ice? (the blue overlay is extra and idm if no one can answer that)
If this question exists and already has been answered, please just send me the link, I searched but never found anything.
Thanks! :D
You can use slowness but without the particles, that is a procedure block too.
Also if you still don’t like having the slowness I think constantly teleporting the mob to itself might work, but that could be complicated.
Oh yes I didn't think about the teleport thing. I dont think it would be too hard, except it might make the screen glitch out for the player. Before I got this reply I had went with the slowness procedure block without ambient and particles in fact, and it doesnt show up on the screen, but does on the side of your inventory when you open it. Well, either way, thanks for the feedback and i'll update you later!
You can just turn off the entity NBT tag AI.
Ok thanks
override velocity motion of entity vx vy and vz to 0 for every tick will work smoothly without glitching
To make screen kind of blue you can use this code, but I,m not sure that it work
@Override @OnlyIn(Dist.CLIENT) public void renderHUDEffect(LivingEntity entity, int amplifier) { Minecraft mc = Minecraft.getInstance(); if (mc.player == entity) { float partialTicks = mc.getFrameTime(); mc.getEntityRenderDispatcher().getRenderer(mc.player).render(mc.player, partialTicks, 1.0F, partialTicks, partialTicks, partialTicks); mc.getEntityRenderDispatcher().overlayColor(0.2F, 0.5F, 1.0F, 0.3F); // Kolor RGBA (0.2, 0.5, 1.0 to odcienie niebieskiego) } }