Started by
Sekend_
on
Topic category: Help with Minecraft modding (Java Edition)
Hello, I have a GUI connected to a block and when you click the "Buy" button this code is executed. I would like that one armor cost 100 Idamanten and that this will then be removed. Now I have the problem that if you only have 60 diamonds they are pulled off and you still get the armor. Now the code should recognize how many diamonds I have and only remove the diamonds and give out the armor if there are 100 diamonds. Can somebody help me?
Is because you only say that this is supposed to happend when the player has diamonds in inventory, but you don't say that there has to be 100. When the game remove the diamonds it search 100, but if there is less than that it will remove then too because there are diamonds in player's inventory.
can you help me to do this
I'll try, let me test it.
Well, I did it, more or less, I don't know how to check if the player has a number of items in the inventory, so i created a GUI in a block and made that, if in the slot 0 there are 64 diamonds, it will give you the armour. If you create another slot you can make that, if in slot 0 there are 64 diamond, check if there are 36 in slot 1 the same way it check the first and then it give you the armor. Here I'll let you the procedure I used.
Well, the image is this, I can't see it in my comment so I'll let the link here https://ibb.co/fSbM9h7.
Thank you, you kept me very busy
Well, I don't understand a lot of english so I don't know what you arre trying to say, but your welcome I guess.