Started by
Pandeo_F1
on
Topic category: Help with Minecraft modding (Java Edition)
Hey !
I want to extract trades from pnj. But i have found nothing in "Procedure" part on Mcreator. For the moment i can just detect if the clicked entity is a Villager. But i want to made a program who can return the list of all item (Needed item and given item) on the chat or in a variable when you open a villager interface.
If you can help me to found a way to get the list of trade item with the entity id of the villager or something like that thanks you ^^.
MC Version : 1.17.1
Client side.
Hi!
The way you checked if the entity that was right-clicked is a villager isn't right, it could still work, but that solution contains too many blocks in my opinion.
Look at the image below to see what it should look like.
That's all the information I could give to you, for now, you need to be a little clearer if you need me to explain what else you want to do with your procedure, that's it for now though :)
Also just a reminder!
If you are trying to open a GUI if the player right-clicks on a villager, you probably shouldn't do that since the base game itself, Minecraft, already has a built-in GUI for a villager, at least for the workers.
Yeah thanks for your blocks i have change by your. I need that when we open the interface of a villager that I can save the trades he offers to be able to save them in a file (the saving part in a file I know how to do it) but I don't know how to retrieve all the trades of the villager in String format
If its not possible with the block to recover the trades list you can help me in java directly
I have try to get the nbt data of the villager but there is nothing inside :/
Why inside CompoundTag tag = entity.getPersistentData();
There is nothing inside : tag.getAsString()
Same for : tag.getDouble("Orders")