Closed RebelDs closed 1 year ago
Minecraft Advancement File Format allows to specify a different "reward" things: https://minecraft.fandom.com/wiki/Advancement/JSON_format
So it means, if someone creates a data pack where a reward is an item, then viola... infinite item duplication.
Unfortunately, I do not see any way to prevent this in the Bukkit API. The Advancement API does not allow advancements to be cancelled. There is only one event: PlayerAdvancementDoneEvent
and it is non-cancellable. It just informs me that the advancement was done. The only thing I can do is revoke the advancement immediately. There is no information on the rewards of the advancement.
Here are some ways I can think of supporting this:
The last is no work for me, so that's the fastest workaround. 2 sounds unfair and would be a hack. 1 is a lot of work, but would be the most seamless to the user.
I would say that there is one more thing that could be used. md_5 even responded to one if features requests for improving the advancement handling in bukkit:
Use an API which has more function.
And there are several of them. I would suggest to use Crazy advancement API as it is very advanced, however, much simpler advancement manager may work too
Until a fix is being found, can we have a config option that would allow players to receive XP regardless of the Box they complete the achievement in? At least the achievement would be completed and they wouldn't be able to farm the XP / items for infinite amounts. I'd rather have them easily complete achievements than taking advantage of this issue.
bump
@RebelDs I added an option in config. I'm also going to look at the API that BONNe mentions.
Out of date now.
Expected behavior
When a player attempts to complete an achievement OUTSIDE his box (meaning, in another player's box), the achievement should be revoked AND the XP gain should be cancelled in order to prevent infinite XP farms.
Observed/Actual behavior
Although Achievements are prevented from being completed outside a player's box, they still gain XP from the attempt (Vanilla XP that comes with the achievement), and they can do so an infinite amount of times for easy XP.
Steps/models to reproduce
BentoBox version
[13:14:50 INFO]: Running AIRPLANE 1.16.5. [13:14:50 INFO]: BentoBox version: 1.16.6 [13:14:50 INFO]: Database: JSON [13:14:50 INFO]: Loaded Game Worlds: [13:14:50 INFO]: boxedworld (Boxedworld): Overworld, Nether, The End* [13:14:50 INFO]: Loaded Addons: [13:14:50 INFO]: Bank 1.3.0 (ENABLED) [13:14:50 INFO]: Border 3.1.1 (ENABLED) [13:14:50 INFO]: Boxed 1.1.5 (ENABLED) [13:14:50 INFO]: Challenges 0.8.4 (ENABLED) [13:14:50 INFO]: Chat 1.1.4 (ENABLED) [13:14:50 INFO]: ControlPanel 1.13.0 (ENABLED) [13:14:50 INFO]: ExtraMobs 1.11.0.3 (ENABLED) [13:14:50 INFO]: Level 2.6.4 (ENABLED) [13:14:50 INFO]: MagicCobblestoneGenerator 2.3.0 (ENABLED) [13:14:50 INFO]: VoidPortals 1.5.0.0 (ENABLED) [13:14:50 INFO]: Warps 1.10.2 (ENABLED)
Plugin list
Plugins (55): BeautyQuests, BeautyQuestsAddon, BentoBox, Boss, BuycraftX, ChatColor, ChatGames, Chunky, Citizens, ClearLag, CMI, CMIEInjector, CMILib, CrateReloaded, CrazyAuctions, DeluxeCoinflip, DeluxeMenus, DeluxeTags, DisableJoinMessage, DropEdit2, eGlow, FastAsyncWorldEdit (WorldEdit), HeadDatabase, InteractiveBooks, IPWhitelist, JetsMinions, Jobs, KGenerators, LagAssist, LiteBans, LuckPerms, Multiverse-Core, NoUnicode, OriginalAntiAnvilDupe, OriginalDonatorsCore, OriginalStaffArrangement, OriginalTPSCommands, PlaceholderAPI, PlayerPoints, PlugMan, ProtocolLib, ShopGUIPlus, Shopkeepers, spark, SuggestionBlocker, TAB, TerraformGenerator, TradeMe, Vault, ViaVersion, VoteParty, WorldBorderAPI, WorldGeneratorApi, WorldGuard, WorldGuardExtraFlags
Other
https://youtu.be/rCrE26FdPdQ Here's a video of how this bug works. Please note that this bug is not in any way tied to the XP Bottles held by one of our staff members in the video. We've tested it with achievements that have nothing to do with XP directly, and the bug is still present.