How to give a player xp orbs or levels? How I make a block to consume my item?

Started by MrCROCO on Sun, 04/11/2021 - 11:38

Topic category: Troubleshooting, bugs, and solutions

Last seen on 23:48, 16. Apr 2021
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to give a player xp orbs or levels? How I make a block to consume my item?
Sun, 04/11/2021 - 11:38

So I am trying to do a block that when you click a butoon in it, it takes a coin from the first slot and gives you back xp orbs or levels depending on what tipe of coin it gets.

-Problem number one: it doesn't take the coin

-Problem number two: It doesn't gives any xp at all
I am using version MCreator EAP 2021.1 b12313
I am new at this, I have tried it in the past but not that much just to add some animals.
I have maked it into a procedure and this is it:
If {get copy of item from slot 1 of block at x y z if it has inventory=Item(Zombiecoin)}
do{remove 1 itemsfrom slot 1 x y z if it has inventory, add 5 xp to entity/target entity}
else if{get copy of item from slot 1 of block at x y z if it has inventory=Item(Skeletoncoin)}
do{remove 1 itemsfrom slot 1 x y z if it has inventory, add 10 xp to entity/target entity}
else if{it repeats for the other kind of curency that i added}