How do i make a variable that goes to every player, and how do i change it when i right click an item?

Started by gamerboy37 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i make a variable that goes to every player, and how do i change it when i right click an item?

So im making a currency mod. It has a wallet, but it currently stores cash. I either need to make it stay on death while keeping the inventory, or make it so it just gives cash based off of a player variable, but i need to make it. I think i could start with an "attribute" but i don't see anything about it being changed (mainly talking about in the procedures).

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok wait i found a thing in…
Fri, 06/20/2025 - 03:48

ok wait i found a thing in procedures to change the attribute. Now i need a way to show an attribute for a player in a gui.

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok now i got that last one,…
Fri, 06/20/2025 - 04:26

ok now i got that last one, and i just need to find out how to make a thing work. i right click on a dollar bill (it would be in a stack of 1, 1 dollar bill.) and it works. adds 1 to my cash attribute, and dissapears from my inv. But when i right click a stack of 2, 1 dollar bills, it adds the cash but nothing goes away. I'm using a "(Remove <(1) <([Dollar Bill]) from <(Event/Target Entity) main inventory)" Block. I don't know what the problem is. I don't know a way around it. Can anyone help me or should i just make it so you have to input money while in the wallet gui (which would honestly make a lot more sense and be kinda cooler for the detail)