Started by
K3vax
on
Topic category: Troubleshooting, bugs, and solutions
Hey, everyone!
So I am aware that we can't simply add custom trades with villagers or with created villagers. But I am making a mod with a special villager that opens up a GUI for trades.
Now in the GUI, the player can choose from a selection of buttons to make a trade. I've added a procedure where the GUI would then close, the 'currency' item is removed from the player's inventory and the 'product' item is then added in.
Now when I try this in-game, the button doesn't do anything.
Does anyone know how to make this work?
If you're using it for GUI with slots, bind it with a block that has inventory, even if its a non unobtainable block, as long as its binded to a block you'll be fine, then you can make the entity open the gui, and it will work.
Can you show an example? I have no clue what you mean
K3vax, DaleksOfSkar is right. Currently the way to do trading is through blocks that have inventory.
However, I found a way through which you can trade with a mob without the use of any blocks.
From: https://mcreator.net/forum/53182/very-strange-things-happen-when-working-gui-procedures?page=1
GUI:
Input slot (0) > Picture of diamond > Picture of trade_arrow > Picture of sand > button
PROCEDURE:
https://ibb.co/0XSL84Y
This procedure is called when the trade button is pressed.
Where did you get your AND piece?
Logic Operations -> First procedure Block -> Click on "=" -. Choose "AND"
You could Use Run command procedure and Make a Custom Villager spawn with an item or Ritual i plan on add it to my mod Gr33n's Magica in one of the next updates using this > /summon villager ~ ~1 ~ {VillagerData:{profession:toolsmith,level:5,type:plains},Invulnerable:1,PersistenceRequired:1,NoAI:1,Offers:{Recipes:[{buy:{id:diamond_block,Count:1},buyB:{id:diamond_block,Count:1},sell:{id:emerald_block,Count:1},maxUses:9999999}} 9may be messed up lol use a Villger generator and Replace where it says diamond_block and emerald_block with "Modname:Item_name" the Quotation marks are required for it to work
How to make buttons with icons? I moved them (icons and buttons) in component list, but buttons are always cover icons