balance mod

Started by ARTURS on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
balance mod

I’m creating a mod for 2021.1 with a plugin for 1.12.2, and I’m also making a mod for 1.12.2. I need to make an ATM: when you approach it, a menu opens with 2 buttons and 2 slots. In one slot, you withdraw money and take it out; in the other slot, you deposit money and add it to the balance. The balance is a variable that saves data while the player is in the world. After exiting, the balance resets to 0. I’ve done everything, but the item cannot be taken from the slot, and the variable does not update its value.

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
sorry if you checked this…
Thu, 09/11/2025 - 19:49

sorry if you checked this already but did you make the withdraw slot in the gui as an input slot or an output slot? double click on the slot to change the type of slot. only output slots can have items taken out i think

in your workspace, what type of variable is the balance variable? is it PLAYER_PERSISTENT? it should be PLAYER_PERSISTENT

also it would be really helpful if you either describe your procedures (close gui procedure, whatever procedure that you use to update the balance variable, etc) or attach images of your entire procedures. maybe something is going wrong with the procedures. ask yourself some questions about all the possible problems that might be causing this to not work — for example, is the balance variable actually being updated when you use the ATM? 

you can use the "send chat to all players" block to print values to debug the issue. for example you can print the value of the balance variable when the player opens the gui, closes the gui, etc. to see exactly where the problem is happening.