35 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by zedamc#0
This means every villager that spawned and any new villager would have emerald replaced with my coin. It needs to have support for custom model data for it to work
My server is running paper
You can make a custom plugin, which overrides villager trades with emeralds with your own coin
I don't want to rewrite all of the trades just for to change emeralds to my coins
if you can find another plugin which does that then you're good
otherwise yeah u need to code a plugin which does that
Who tf would do it lol
if someone has done it they have no life lol
idk, you can dig deep in the spigotmc caverns
what do you want then
seems like thats exactly what you're asking for
Looking for a simpler way eg. if there exists a plugin which makes the process shorter
I already googled for it
so you want any trade with emeralds to be replaced with coins
but you dont want to overwrite the trades using emeralds with ur coins
I want to be able to replace emeralds with coins but I don't want to write every trade the villager does
just make a plugin go through the trades and replace any emeralds with coins
Does it support custom model data?
u got developer role its not a hard plugin
^
trades does support nbt data
if thats what you were asking
Thanks
SpigotMC - High Performance Minecraft
Solved - Change Villager Trades
Hi Guys!
Im currently working on an Plugin which checks the MerchantRecipes from an Clicked Villager. If the Recipe is an Enchanted Book with Silk...
Solved will keep it open until I do it
Anyone knows why PlayerInteractAtEntityEvent/PlayerInteractEntityEvent doesn't work. I made a few checkpoints and it doesn't say that the event even happened.
VillagerInteractListener file:
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
vU7EdIO.txt
Requested by zedamc#0
I registered events properly in the main file
Is it triggering? Add some print lines
Any errors on load?
I did it here
and it doesn't trigger it
Does the plugin load correctly?
Send your main plugin class
Here is on enable:
public void onEnable() {
this.saveDefaultConfig();
try {
if (!getDataFolder().exists()) {
getDataFolder().mkdirs();
}
database = new Database(getDataFolder().getAbsolutePath() + "/database.db");
} catch (SQLException e) {
e.printStackTrace();
System.out.println("Failed to connect to database! " + e.getMessage());
Bukkit.getPluginManager().disablePlugin(this);
}
this.getCommand("currencyplus").setExecutor(new mainCommand(this));
this.getCommand("withdraw").setExecutor(new withdraw(this));
this.getCommand("mybank").setExecutor(new mybank(this));
this.getCommand("bank").setExecutor(new bank(this));
this.getCommand("bank").setTabCompleter(new bankTab());
this.getCommand("currencyplus").setTabCompleter(new mainCommandTab());
getServer().getPluginManager().registerEvents(this, this);
Bukkit.getPluginManager().registerEvents(new JoinListener(this), this);
Bukkit.getPluginManager().registerEvents(new VillagerInteractListener(this), this);
Bukkit.getPluginManager().registerEvents(new BlockDestroyListener(this), this);
Bukkit.getLogger().info("[CurrencyPlus] Enabled");
}
Other events work fine
Yes it does
bump
bump
is there any reason you dont just listen to inventory open event
Already tried it but I don't think I can change trades that way
why not
Merchant inventory only has these 3 inventory slots
And it seems like this isn't included in it
yeah but you can do getMerchant()
did you not look at all at the methods for merchant inventory
you could also have casted .getHolder() to a merchant/abstractvillager
assuming you already had checked that the entity actually is a merchant
i promise you it is going to be Very Important to just research a bit when doing stuff
if you give up on ways to do things because you are too lazy to research you will make things substantially more difficult
Thanks for help, I will do more research in the future