Trident get copied
yumjunstar opened this issue ยท 10 comments
Preliminaries:
- Shopkeepers version: `2.9.1'
- Spigot version:
paper-126
- 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 (paper-126) with the latest version of Shopkeepers (2.9.1), 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.
- Step-by-step instructions on how to reproduce the issue.
- Observed behavior.
- Expected behavior.
- If items with special attributes are involved: Include instructions on how to create those items.
- Server logs (from server startup until issue). Consider enabling debug mode in the config for additional console output.
- If modified from default: Plugin configurations.
- .. Anything else that might be useful to reproduce and identify the issue.
To see this video would help you understand this issue
https://www.dropbox.com/s/jewxwqx1ud7kzdb/2020-03-04%2014-16-10.flv?dl=0
- /shopkeepers command
- Put any trade item in villager
- hold trident
- Right click villager .
- Trade item
- press esc key to quit trade menu
- And trident get copied
This issue is not reproduced by normal vanilla villager
Thanks, I was able to reproduce this on Spigot as well. I think I know what the issue is here, but I still need to decide on how to fix it.
This issue only occurs if you shift-click trade with the villager, correct?
I also opened a Spigot issue in case they want to fix this for all plugins in some way: https://hub.spigotmc.org/jira/browse/SPIGOT-5608
Thanks, I was able to reproduce this on Spigot as well. I think I know what the issue is here, but I still need to decide on how to fix it.
This issue only occurs if you shift-click trade with the villager, correct?
Sorry, "shift-click trade with villager" means only shopkeepers' villager? If so, Yes It only occur with shopkeepers' villager. Other villager reflects trident
Every shopkeepers villager may copy trident
Is it your question's answer?
I also opened a Spigot issue in case they want to fix this for all plugins in some way: https://hub.spigotmc.org/jira/browse/SPIGOT-5608
Thank you for reporting this issue
No, I meant whether you can only reproduce this when shift-clicking inside the trading interface (to buy multiple times in bulk). My assumption is that this issue only occurs if you buy multiple times from the villager (in your video: you insert multiple arrows and then use shift-click to trade multiple times).
No, I meant whether you can only reproduce this when shift-clicking inside the trading interface (to buy multiple times in bulk). My assumption is that this issue only occurs if you buy multiple times from the villager (in your video: you insert multiple arrows and then use shift-click to trade multiple times).
Ah I have understood what you say
I checked video again and noticed that I traded it without using shift-click in first trade
You assumption may be correct. I'm going to check your theory within few hours in game
But sorry, I need to sleep now
Thank you for helping me
My plan for fixing this is to prevent any item actions to start when a player is interacting with a shopkeeper (similar to how tridents are not charged when you interact with a regular villager). Unfortunately there are still two Spigot issues that interfere with this:
- https://hub.spigotmc.org/jira/browse/SPIGOT-5609: The client still displays the animation even after the item action got prevented. (This is a rather minor issue since it is only affecting visuals)
- https://hub.spigotmc.org/jira/browse/SPIGOT-5610: In some cases plugins are not able to correctly prevent the item interaction since Spigot is accidentially omitting a corresponding interact event.
My plan for fixing this is to prevent any item actions to start when a player is interacting with a shopkeeper (similar to how tridents are not charged when you interact with a regular villager). Unfortunately there are still two Spigot issues that interfere with this:
- https://hub.spigotmc.org/jira/browse/SPIGOT-5609: The client still displays the animation even after the item action got prevented. (This is a rather minor issue since it is only affecting visuals)
- https://hub.spigotmc.org/jira/browse/SPIGOT-5610: In some cases plugins are not able to correctly prevent the item interaction since Spigot is accidentially omitting a corresponding interact event.
Then, as temporary mesasure, why don't you remove villager's invulnerability and make its health infinite
As a result, villager reflect trident
'Trident reflection' is not the issue here. For regular villagers you are not even launching the trident if you right click them (since it opens their trading interface then and somehow knows not to charge the trident in that case). I am trying to reproduce that. Also the problem isn't trident launching itself, but that trading with the shopkeeper (via shift-click trading) modifies the inventory (including the trident slot) while the player is still charging the trident in the background. This inventory modification replaces the trident item inside your inventory with a new, exact copy. Once you exit the trading interface the originally charged trident item is launched, while the new copy remains inside the inventory -> Trident is duplicated.
I have a solution ready that avoids modifying the trident slot if it is not affected by the trading. However, this only works as long as the used item (eg. the trident, but any other interactable item as well) is not affected by the trading.. In that case it would be preferred to stop any item actions to take place in the first place, but that is currently not possible to achieve due to the above mentioned Spigot bug (5610).
If you join the discord server I can send you a snapshot that likely fixes the issue for tridents. But I am still looking to fix it in general, for other interactable items as well, before I publish an update.
This should for the most part be fixed in v2.9.2. Let me know if this is the case for you as well!
(I am still waiting for the linked Spigot issue to get resolved, but that shouldn't require an update to Shopkeepers then and might only affect a small subset of items (if at all.. I am not aware of any problematic items right now))