Entity teleportation not working correctly

Started by YeSMan20 on

Topic category: Help with modding (Java Edition)

Last seen on 17:33, 16. Jun 2023
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity teleportation not working correctly

So I want my entity to teleport to the player randomly 1 time, but instead, it does it constantly, instead of stopping once it has been teleported
here's my procedure

Last seen on 17:06, 18. Apr 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If it is on entity tick…
Wed, 04/05/2023 - 21:46

If it is on entity tick update, it will run constantly.  You could possibly turn it off by using nbt logic tags(something like:  if customtag=false, check the randomizer, then set customtag to true and run the rest of the procedure).  I'm not posative if custom nbt tags start of as true or false, but it should be easy to check(if it works, it starts as false, if it doesn't, swap the true and false logic)