Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
Avatar for Kyle

Replace vanilla's buried treasure search with a fast one to prevent crashes

Report OkTreasures?

OkTreasures

⚠ This plugin requires treasure-maps.enable: false in your paper-world-defaults.yml config !!! ⚠

Please report bugs to the support Discord. or the GitHub

Vanilla Minecraft has a bug where the buried treasure search is so slow that it can sometimes freeze your game. It also happens in multiplayer, if anyone opens a buried treasure search, the server can sometimes crash. Contrary to what the bug tracker says, as of Minecraft 1.20.1, this is not fixed.

This plugin fixes these types of crashes by replacing the vanilla buried treasure search with a custom, faster and simpler one: it just picks a random beach within reasonable distance and places the treasure there. Since this is mostly asynchronous, it won't cause lag.

Limitations

  • OkTreasures does not work in worlds that are not the default, vanilla generation (e.g. worlds generated using plugins or datapacks)
  • The plugin picks totally different treasure locations than vanilla Minecraft would. While you can still use /locate to find vanilla buried treasures (not recommended), you won't find any OkTreasures maps in shipwreck chests pointing to these
  • The map the plugin gives you looks different from vanilla maps
  • There is a known issue where the plugin may stop working for up to a few minutes (worst case scenario) if you run /spreadplayers spanning a radius of over 32 thousand blocks, because the plugin will be busy finding beaches in all the newly visited regions. This depends on hardware, and your mileage may vary

Notes

  • Placing a treasure won't override player builds, it'll only place a treasure if the top block of the location is sand, and if there's a certain number of sand blocks below where it can be buried
  • This plugin operates in 8192 x 8192 regions in the world, keeping the beaches it finds in each region and neighbors (radius=1) in memory. The plugin takes nearly no CPU power, unless: 1. Someone crossed a region boundary 2. Someone logged in 3. A shipwreck appeared within someone's view distance

*This plugin uses only the Paper API, so it's likely it will be compatible with future Minecraft versions, even if they're not listed here

Image made with Bing Image Creator

Information

CategoryMiscellaneous
Published onAugust 19, 2023
LicenseMIT
Downloads253
Stars3
Watchers4

Pinned Versions

Members

Avatar for Kyle

Kyle

Owner