on player tick update broken

Started by Orandza on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
on player tick update broken

I'm trying to create a sort of chaos mode that randomly chooses an event to happen every now and then. It's a gamerule that can be toggled on and off and it also has a global variable ChaosVar which is where the current event is stored(its possible values will change but currently they range from -1 to 5). One of the events is supposed to make every entity fly high up into the sky if it's grounded or in water(tho it's only a chance per tick). For other entities I used on loaded entity tick update and it works. For players, however, I tried to use on player update tick, and nothing seems to happen. The player doesn't get sent flying up like they're supposed to be.

Here's what I used for players https://imgur.com/6FARmGk

Same thing for entities(well, almost) https://imgur.com/b530mKi

Can anyone help me? I've tried everything, even using other stuff like when player lefts clicks a block, it didn't change anything.

try and change it to world…
Sun, 10/30/2022 - 12:38

try and change it to world tick update, and for each player in the world as entity iterator. Then replace all of the event/target entities with entity iterator.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Still doesn't work(don't…
Sun, 10/30/2022 - 14:54

Still doesn't work(don't mind the fact I changed the odds, I just did that to make sure I wasn't getting unlucky or something) - https://imgur.com/a/e4beme2 

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I ended up "solving" it with…
Sun, 10/30/2022 - 15:54

I ended up "solving" it with the following method: instead of overriding motion vector, the procedure now places down a pressure plate-like block which sends you flying when you collide with it. I tried the "when entity walks on the block" trigger and it didn't work, but with the "when entity collides in the block" trigger, it actually does. It's not a great solution but it does the job. Still, if anyone finds a proper solution, please do let me know.