Giving Item On First World Visit

Started by RamenNoods on

Topic category: Help with modding (Java Edition)

Last seen on 04:54, 27. Apr 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Giving Item On First World Visit

I am trying to give the player an item the first time they join a world. I have a PLAYER_PERSISTENT boolean variable(called JoinedWorld) with an initial false value.
I have a procedure triggered on player tick update that checks if the variable is false. If so, it gives them the item and sets it to true.
It seemed to work perfectly but I noticed the item is also given every time the player returns to the Overworld from The End.

Last seen on 23:48, 26. Apr 2024
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use the "Player…
Mon, 03/18/2024 - 16:45

You can use the "Player Joins World" global trigger instead as the "On player tick" can be laggy. If it keeps giving the player the item that means the variable isn't saving correctly. Are you sure it's PLAYER_PERSISTENT and that you are correctly checking if it's only false and then setting it to true?