I need certain xp to run procedure

Started by jeux2119 on

Topic category: Help with modding (Java Edition)

Last seen on 19:38, 22. Apr 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I need certain xp to run procedure
Fri, 03/29/2024 - 22:20 (edited)

Hello 

 

the problem: it removes XP and summons successfully but it spawns

even when i have no XP it summons them anyways

 

Procdeure:https://imgur.com/a/hdtOW7c

 

and if you didn't understand what i wanted read this:

what i want:

if 10XP----> summon
if 0XP----->dont summon


what is happening:

if 0XP---->summon anyways

Edited by jeux2119 on Fri, 03/29/2024 - 22:20
Last seen on 21:21, 12. Apr 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try this: the issue is that…
Fri, 03/29/2024 - 23:43

try this:

the issue is that you dont have a condition in your code to detect if you have less than 10, so if you have 10 or less, it is still executing your code. (I also changed "remove 10 xp" to "remove 10 xp level", as i assumed they were levels, but if they were xp points, you will need to do some more maths to calculate it using the "get xp level of" and the "get amount of xp needed by event/target entity to gain a level"