Players randomly cannot trade.
Spoonerj1 opened this issue ยท 10 comments
Preliminaries:
- Shopkeepers version:
Shopkeepers-2.7.2.jar
- Spigot version:
Spigot 1.14.4-R0.1-SNAPSHOT (build 2445)
- I have checked that my issue/question does not get answered by:
- The documentation.
- The FAQ.
- The Known Issues.
- I have checked all open and closed issues, but none seems to fit my issue/question.
Reproduction on a fresh and up-to-date Spigot server:
I was <able>
to reproduce my issue on a freshly setup and up-to-date Spigot server (currently Spigot 1.14.4-R0.1-SNAPSHOT (build 2445)
) with the latest version of Shopkeepers (currently Shopkeepers-2.7.2.jar
), with no other plugins and with no kinds of other server or client mods.
The issue:
Provide a detailed description of your problem and add as much information as possible which could help reproducing the issue.
Include:
- Description of the issue.
player trades with shopkeeper using correct items for trade. Verified by doing this myself and having several players test it while I was watching. - Step-by-step instructions on how to reproduce the issue.
We use an unbreakable sunflower as a Vote Coin, using this coin players should be able to buy various MC items from traders in our spawn.
Players must vote for our server on PMC and a few other server lists to get coins. No other method of getting coins exists. - Observed behavior.
Player places items in trade window, trade appears in output slot.
player clicks item in output to take it, and the coins are placed back in the inventory and no item is given from the output. - Expected behavior.
Output item should be taken from trade. - If items with special attributes are involved: Include instructions on how to create those items.
minecraft:give %player% minecraft:sunflower{display:{Name:"{"text":"Vote Coin"}"},Unbreakable:1} 1 - Server logs (from server startup until issue). Consider enabling debug mode in the config for additional console output.
19.08 22:36:25 [Server] Server thread/INFO [Shopkeepers] Inventory click: player=Deejitox, view-type=MERCHANT, view-title=Shopkeeper, raw-slot-id=2, slot-id=2, slot-type=RESULT, shift=false, hotbar key=-1, left-or-right=left, click-type=LEFT, action=NOTHING
19.08 22:36:25 [Server] Server thread/INFO [Shopkeepers] Not handling trade: There is no item in the clicked result slot (no trade available).
- If modified from default: Plugin configurations.
no changes from default. - .. Anything else that might be useful to reproduce and identify the issue.
I can't think of anything to place here, it seems to be working normally for players sometimes, and other times its not. I've just sat here for 2 hours watching players trade with debug enabled, and its completely random when it breaks.
Closing this as I wasn't able to reproduce this with the modified item mentioned above, so there is not much I can further do about this with the information provided.
Try this command: minecraft:give {player} minecraft:sunflower{display:{Name:"{\"text\":\"Vote Coin\"}"},Unbreakable:1b} 1
Explanation:
- Inner quotes are escaped, and Unbreakable is of boolean type.
- Spigot will 'normalize' the item's internal data in various situations (when dragging the item around in the inventory; when the item gets saved by a plugin such as shopkeepers; etc.). Your command does not create the item in this 'normalized' form, therefore it will not match any items that got normalized for some reason. This also explains why the occurrence of this issue is so sporadic: As long as you are comparing 2 unnormalized (or 2 normalized items), everything is fine. Once one of the items involved got normalized for some reason, the items will no longer be considered equal.
Just saw this, will report back if this works. Thanks for the breakdown too, I don't know as much about how items are saved by spigot or plugins as I probably should.
I am still having the same issue with the "new" vote coins. I'm using the plugin "voting plugin" to deliver the coins when a player votes, but there appears to be no difference in the coins I get from the plugin vs the coins I get just using the command. It still appears to be randomly working, but mainly its not working.
I am going to try using a regular sunflower, named Vote Coin. I'll report back again
20.08 11:21:35 [Server] Server thread/INFO [Shopkeepers] Player Spoonerj is interacting with entity at Location{world=CraftWorld{name=casimir},x=260.6788,y=66.0,z=144.9968,pitch=0.0,yaw=80.020645}
20.08 11:21:35 [Server] Server thread/INFO [Shopkeepers] Opening UI 'trading' ...
20.08 11:21:35 [Server] Server thread/INFO [Shopkeepers] UI 'trading' session started for player 'Spoonerj'.
20.08 11:21:35 [Server] Server thread/INFO [Shopkeepers] Player Spoonerj is interacting with entity at Location{world=CraftWorld{name=casimir},x=260.6788,y=66.0,z=144.9968,pitch=0.0,yaw=80.020645}
20.08 11:21:37 [Server] Server thread/INFO [Shopkeepers] Inventory click: player=Spoonerj, view-type=MERCHANT, view-title=Shopkeeper, raw-slot-id=2, slot-id=2, slot-type=RESULT, shift=false, hotbar key=-1, left-or-right=left, click-type=LEFT, action=NOTHING
20.08 11:21:37 [Server] Server thread/INFO [Shopkeepers] Not handling trade: There is no item in the clicked result slot (no trade available).
20.08 11:21:38 [Server] Server thread/INFO [Shopkeepers] Player Spoonerj closed UI 'trading'.
20.08 11:21:38 [Server] Server thread/INFO [Shopkeepers] UI 'trading' session ended for player 'Spoonerj'.
those photos posted in reverse order... the first image is at the bottom, the last image with a completed trade is at the top
I just tried again, via the command and by using VotingPlugin to execute the command, and I can't reproduce any issues with the command I gave above. I also tried it after reloading Shopkeepers, and I tried after dragging the item around in the inventory (causes Spigot to normalize the item).
Video of some of my testing: https://oc.h-in-t.net/nocloud/index.php/s/TAqjldu7VfuTw6M
Have you verified that you are testing with the correct item after changing the command? Have you freshly setup your trades with that new item?
Otherwise, another guess would be that maybe some plugin might be interferring. Do you run any plugins which might modify players' items? Do you use ViaVersion?
Can you reproduce the issue on a fresh and up-to-date Spigot server?
I update the spigot build as soon as it available, we the players know that sometimes that means there are bugs in the plugins.
Let me do some more comparing, I wonder if I might have permissions wrong, I use Luckperms for that and have had it installed with shopkeepers during tests
I do have a chest sorting plugin also, but it seems to have no effect if it is enabled or disabled. the issue still randomly happens...
is there a fix for this yet? im not the owner of the server, just a player, but having the same issue happen on one im on. trying to find some way to fix, so i can pass it along to the owner.
I was so far not able to reproduce the described issue after using the modified item mentioned above.
My guess is still that this is an issue with the item used inside the trade and the items offered to the trader. To fix the shopkeeper, both the items used by players, as well as the items the trades got setup with need to be adjusted.
One way to compare the data of items in-game is by getting the item from the shopkeeper, and the item used for the trading, put them both into a chest (carefully, to not trigger any 'item dragging' inside the inventory when placing the item in a slot) and then use minecraft's /data command to print the data of that chest.