i need help with variables

Started by MooSheeRoo on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i need help with variables

can someone esplain variables to me? im trying to make a mod for equivelent exchange and i have gui that has a button that when you click it its spose to take 1 mutton, 1 steak, and 1 pork and give you a food i made back but when i click the button even without the item in my inventory it still give me my modded food. if someone could help me with this it would be greatly aprieceated 

Joined Aug 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also i really think the wiki
Tue, 08/29/2017 - 23:00

also i really think the wiki page should esplain how to use variables

Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:also i really think the wiki
Wed, 08/30/2017 - 09:12

@#1 You don't need variables for this, but conditions.

You need to create a stack event with the condition "if player has in inventory mutton", then add another stack event in the previoous one and here add the condition "if player has in inventory steak", then repeat the process for the pork steak and in that last stack event add 3 "consumes item in inventory" 1 for steak, 1 for mutton, 1 for pork and then, add the event "add item to inventory" with your food.