Shopkeepers

Shopkeepers

2M Downloads

Shopkeepers are ignoring NBT tags?

BadAimWeeb opened this issue ยท 5 comments

commented

People in my server can use normal item to trade with premium item. Please, fix it!
OS version: Windows Server 2012 R2 x64
Java version: 1.8.0_161
Server version: 1.8-R0.1-SNAPSHOT (1.8.8)
Shopkeepers version: 1.68/1.86
Here's video about this bug: https://www.youtube.com/watch?v=GgXfT-igHyw&feature=youtu.be

commented

I just tried to reproduce this on spigot 1.8.8 and was not able to do so.
I assume this is an admin shopkeeper in the video? Shopkeepers doesn't handle the trading, but only sets up the trading recipes, and then minecraft itself handles the trading logic and handing out of items. Minecraft changed its trading logic in MC 1.8, so if this is really running on MC 1.8 then this trade should get prevented by minecraft itself.

As the item isn't even displayed in the trading result slot, I highly assume that this might be a caused by an interference with some other plugin.
Do you by chance have any kind of 'protocol' plugins running?
Or maybe you are using some other plugin which is disguising item information in some way (I know that Denizen is/was doing somthing like this in the past, or plugins hiding item attributes, or per-player information on items). Usually though this results in issues were the shop doesn't accept the item, even though the items appear to be perfectly matching..
You could turn on debug mode and check what it logs to the console when you trade. If there is no item displayed in the result slot, it should log 'no trade available'. Otherwise there is some discrepancy between what you are seeing the items to be and what the server is seeing them to be, which can very likely be caused by plugins hooking deeply into the minecraft server or protocol.

In either case, try to reproduce this on a fresh spigot server without other plugins running. And if the issue is gone there, you will have to go through your plugins to find out which one is conflicting here.

Or this is caused by a minecraft or spigot bug, but I assume that this is unlikely compared to this being caused by another plugin. If you can reproduce this issue even on a fresh spigot server, try to also reproduce it on an up-to-date spigot server.

And of course use the lastest version of Shopkeepers during your testing (v1.86): It should still support minecraft versions down to 1.8.

commented

Look like 'protocol' plugins is causing this.
Test on fresh server, it has no problem.
Here is plugins list of my server:
[13:31:45 INFO]: Plugins (60): OreGen2, MinionsFree, SimpleBroadcast, AntiCreeper, TimeFold, NapThe, PlugMan, ConsoleSpamFix, OreGenerator, AntiJoinBot, DeathDropsAPI, MOTD, ViaVersion, Tablist, HealthBar, FastCraft, Essentials, NBTEditor, AgarthaLib, AnimatedNames, ClearLag, ActionHealth, Multiverse-Core, ProtocolLib, NoCheatPlus, FastAsyncWorldEdit, DisableWither, EssentialsChat, TrollCommandsPlusPlus, KiemYasuo, MysteryBoxes, PermissionsEx, Lottery, Vault, HolographicDisplays, VipZero, PlayerPoints, MyItems, SkinsRestorer, ChestCommands, LockedItems, PlayerVaults, EssentialsSpawn, WorldEdit, MyPet, LinkItem, Banknotes, Citizens, TradeMe, SuperVanish, AuthMe, WorldGuard, CustomEnchantments, uSkyBlock, InfoBoardReborn, CS-CoreLib, ArmorStandTools, Slimefun, SlimefunLuckyBlocks, Shopkeepers
I'm thinking ProtocolLib, ViaVersion is doing this, so @dmulloy2 @MylesIsCool
EDIT:
image

commented

Which client version are you using to connect to your 1.8 server? I will see if I can reproduce this later with ViaVersion, but if this is really caused by it then this is probably something for them to be fixed.

commented

1.12.2.

commented

Okay, I was able to reproduce this even without ViaVersion on spigot 1.8-R0.1-SNAPSHOT. I also tested with spigot 1.8.8, and it doesn't have this issue.

If you connect with minecraft client version 1.8 it will even show the item properly in the trading result slot. And if you join with, for example, 1.8.9 it will display an empty slot but still allow the trade.

So I highly assume this is an issue (or even "intended-behavior" at that point) with vanilla minecraft at version 1.8. They changed the trading logic somewhere in 1.8 (previously minecraft would allow the trade as long as the item ids match, exactly the behavior you see). So maybe this particular version of 1.8 didn't contain this change yet..

My recommendation would be to update your server. If you for some reason cannot update your server beyond 1.8 then at least try out some slightly newer versions of 1.8. 1.8.8 for example works, so somewhere in between this behavior seems to have changed.

Alternatively, shopkeepers contains a setting 'use-strict-item-comparison': With this enabled, shopkeepers will manually prevent the trade if the item doesn't perfectly match the required item. This was originally meant for servers using MC 1.7 or older, but it might work for your case as well.
Players using MC 1.8 as client version will however still see the item in the result slot, but they will simply not be able to pick it up. This might look confusing, so updating the server would be favorable than to using this setting..