A
Admincraft7mo ago
Zeda

Replacing emeralds with my custom coins

Title
35 Replies
Admincraft Meta
Admincraft Meta7mo ago
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
Zeda
ZedaOP7mo ago
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
Cerial
Cerial7mo ago
You can make a custom plugin, which overrides villager trades with emeralds with your own coin
Zeda
ZedaOP7mo ago
I don't want to rewrite all of the trades just for to change emeralds to my coins
Cerial
Cerial7mo ago
if you can find another plugin which does that then you're good otherwise yeah u need to code a plugin which does that
Zeda
ZedaOP7mo ago
Who tf would do it lol if someone has done it they have no life lol
Cerial
Cerial7mo ago
idk, you can dig deep in the spigotmc caverns
Cooleg
Cooleg7mo ago
what do you want then seems like thats exactly what you're asking for
Zeda
ZedaOP7mo ago
Looking for a simpler way eg. if there exists a plugin which makes the process shorter I already googled for it
Cooleg
Cooleg7mo ago
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
Zeda
ZedaOP7mo ago
I want to be able to replace emeralds with coins but I don't want to write every trade the villager does
Cooleg
Cooleg7mo ago
just make a plugin go through the trades and replace any emeralds with coins
Zeda
ZedaOP7mo ago
Does it support custom model data?
Cooleg
Cooleg7mo ago
u got developer role its not a hard plugin
Skullians
Skullians7mo ago
^
ProGamingDk
ProGamingDk7mo ago
trades does support nbt data if thats what you were asking
Zeda
ZedaOP7mo ago
Thanks
Skullians
Skullians7mo ago
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...
From An unknown user
From An unknown user
Zeda
ZedaOP7mo ago
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.
Zeda
ZedaOP7mo ago
VillagerInteractListener file:
Admincraft Meta
Admincraft Meta7mo ago
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
Requested by zedamc#0
Zeda
ZedaOP7mo ago
I registered events properly in the main file
Skullians
Skullians7mo ago
Is it triggering? Add some print lines Any errors on load?
Zeda
ZedaOP7mo ago
I did it here and it doesn't trigger it
Skullians
Skullians7mo ago
Does the plugin load correctly? Send your main plugin class
Zeda
ZedaOP7mo ago
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
Cooleg
Cooleg7mo ago
is there any reason you dont just listen to inventory open event
Zeda
ZedaOP7mo ago
Already tried it but I don't think I can change trades that way
Cooleg
Cooleg7mo ago
why not
Zeda
ZedaOP7mo ago
Merchant inventory only has these 3 inventory slots
No description
Zeda
ZedaOP7mo ago
And it seems like this isn't included in it
No description
Cooleg
Cooleg7mo ago
yeah but you can do getMerchant()
Cooleg
Cooleg7mo ago
No description
Cooleg
Cooleg7mo ago
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
Zeda
ZedaOP7mo ago
Thanks for help, I will do more research in the future

Did you find this page helpful?