Gui Event Trigger Help! : I want to make a vending machine that uses two pieces of gold to exchange iron.

Started by dkrdjdi on

Topic category: Help with modding (Java Edition)

Last seen on 10:11, 29. Sep 2021
Joined May 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Gui Event Trigger Help! : I want to make a vending machine that uses two pieces of gold to exchange iron.

https://imgur.com/pvO8prv

▲Link above (screen shot)Trigger's situation

I want to make a way to get iron by consuming two pieces of gold.
However, only one gold is enough to get iron.

What should we do over there?

Last seen on 21:15, 8. Jan 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well, that's just one more…
Sun, 05/10/2020 - 11:06

Well, that's just one more condition;

Instead of testing two times for the same, use:

 

Event trigger {​

if ( AND {

( ( get number of items from slot ( 1 ) of the currently open GUI ) = ( 0 ) )

( ( get number of items from slot ( 0 ) of the currently open GUI ) = ( 2 ) )

( ( get item from slot ( 0 ) of the currently open GUI ) = ( gold piece ) )

} ) DO {

( remove ( 2 ) items from slot (1) of the currently open GUI )

( set ( 1 ) ( iron ingot ) in slot (1) of the currently open GUI )

​​​​​​} 

​​​​​​} 

I hope it is possible to understand that kind of writing;

Last seen on 10:11, 29. Sep 2021
Joined May 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you.
Fri, 08/28/2020 - 09:42

Thank you.