[SOLVED]Help with periodic experience gain

Started by PansyGum on Sun, 02/07/2021 - 05:27

Topic category: Help with modding (Java Edition)

Last seen on 17:10, 25. Mar 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
[SOLVED]Help with periodic experience gain
Fri, 02/12/2021 - 17:48 (edited)

what I've tried

Hey all. I'm pretty new to MCreator and having some trouble with this procedure. I'm trying to make it so that, whenever the player is holding this sword, they gain 1 XP every 5 seconds. So far, I have not been able to get it to work. I've also tried a similar setup with Add 1 XP to Source Entity too. Can anyone tell me what's wrong with my procedure here? I figure it'd not the right way to go about this but so far I'm stumped. It's set to run in the "When tool in hand tick" slot.

Edited by PansyGum on Fri, 02/12/2021 - 17:48
The local variable will not…
Sun, 02/07/2021 - 16:33

The local variable will not persist across procedure runs. Read https://mcreator.net/wiki/variables

Also,I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3E…;

Last seen on 17:10, 25. Mar 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks for the response…
Thu, 02/11/2021 - 14:59

Thanks for the response Klemen. I checked out the link and switched to using NBT tags - works like a charm. I'll do some more reading before posting next time, the documentation is really helpful.

Working procedure