How do you add items to inventory based on a variable?

Started by JAK_the_Cyborg on

Topic category: Help with MCreator software

Last seen on 03:19, 17. Feb 2024
Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do you add items to inventory based on a variable?

I have a variable called "apple," which counted how many items was in a user's inventory. However, when I put this in the code builder:

Add: (Getlocal:applecount)  (Golden apple) to player's inventory

It always comes up with build errors. I am on version 2020.2, and I wonder why this happens. If someone has the answer to this, that would be appreciated.

Last seen on 20:38, 30. Dec 2022
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you call for a local…
Fri, 06/26/2020 - 01:53

When you call for a local variable, it applies only for the variables created for that procedure. I can't see the image but if it's a global variable, it can't be called as a local one.

It would help if you sent the build error in this thread for analysis