Topic category: Help with Minecraft modding (Java Edition)
I'm trying to make a mod when you use a magic item the player gets an effect where the player will levitate up and down while blinden. I have made this with the effect procedure but the problem is if you open your inventory the player can see the effects being applied like the icons in right corner of the inventory.
91Arrows commented a workaround:
- instead of using levitation and slow falling, use the block "Attempt to override motion vector of [Event/target entity] to", and set the y value to around 0.1 when going up and -0.1 when it's going down, and instead of blindness, if you don't want to show the effect, use your own overlay
I tried this in many possible ways like this one with a test item:
https://imgur.com/a/Ya3k6Qi
I tried it with the set gravity to true asswell but the same thing happens exept the player now just doesnt fall down.
Tried with every Y position block there is but the same thing will happen or the player just wont move p and down untill its hit and moves for 1 tiny bit and then gets stuck again.
Could anyone try to help me with this? :D
Ok so when overriding the motion vector's you'll want to add a math operation, that reads
x
y velocity of entity + #
z
This will attempt to add the current velocity to the # you input. if you want a continuous floating effect leave it like this, but if you want it to launch the player up but not continuously float up while holding right click, then add a if statment that says IF entity is on ground > do your logic.
https://i.imgur.com/KvBz225.mp4
Not really what i was looking for but still thanks! Helps a lot with different things i planned:D