Changing velocity for player doesn't work in "For each entity in radius"

Started by beloiswhite on

Topic category: Help with modding (Java Edition)

Last seen on 16:28, 18. Jan 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Changing velocity for player doesn't work in "For each entity in radius"

Trying to pushing all entities in radius of block. It excellent works for mobs, but not for a player. Using MCreator 2023.3

P.S. I've tried to send messages to player in radius, and it can find a player, but as i said - won't affect on velocity.

 

Block has 20 ticks, and procedure linked to onUpdate trigger.

Last seen on 14:57, 22. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've had the exact same…
Sun, 09/24/2023 - 17:15

I've had the exact same issue. I still don't know why this is the case, but there is a weird workaround. But to be clear, it's a pretty weird workaround.

This doesn't work when called from a block, but for some reason, if an entity calls the same procedure on update tick, it works fine. In short, you can make an invisible, unkillable entity, with a limited lifespan, (Give it a couple seconds of Luck or something when it spawns, then despawn it when it runs out); and then have that entity run a procedure on update tick that does the exact same thing, and it should work. If you want to actually launch stuff away from the block instead of upwards, that's also very much possible, but substantially more complicated/math intensive.

...I would also keep in mind that if you're increasing Y velocity by 0.5 every update tick with no upper threshold, in a 10 block radius, you're really going to launch stuff. Though I assume that's the goal.