Anyone know how to create a trading system for custom mobs

Started by davidS on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Anyone know how to create a trading system for custom mobs

hello I don't know english I use google translator I create a dwarf villager in mcreator but I can't make an exchange system someone can help me also I don't know anything about programming if you could make a video explaining how to do it I would appreciate it 

version mcreator is 2020.3

Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know how to do this as it…
Wed, 06/03/2020 - 21:11

I know how to do this as it is in my mod currently, but it does take a lot of time. I may make a tutorial video in the future but if you would like me to give you a detailed tutorial I can try!

Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hello yes of course thanks…
Fri, 06/05/2020 - 03:03

hello yes of course thanks if you could give me a detailed tutorial I would appreciate it

Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Alright sorry about the…
Mon, 06/22/2020 - 20:53

Alright sorry about the delayed response! But from what I found its fairly simple. I don't have much time right now but the basics is that when you want a mob to respond to a right click to open the GUI, you need to target the core entity. Make your GUI, connect these 2 things and then make a button for where people will be able to submit their trades. Set a procedure to check an item in their inv. For example, dirt. It can only check 1 at a time so its a bit clunky but its workable. So with an if do else statement, in your if statement you want to check if that item is in the players inventory. If it is it will check again and remove that item. If not play a message or something. But in the second if statement in the else section you need to send the message or whatever indication they don't have enough and add back the item they lost. This way if the buy fails and they have more than 1 they wont lose their items. Simply copy and paste the procedure into itself over and over until you've hit your require amount. I usually use the number of items being added back as a count as it will always be 1 below the total number of items it takes. Once this is done simply make this procedure occur when clicking the button and your good to go! If you need more help or need me to rephrase things I would be glad to do so.