Carpet

Carpet

2M Downloads

biome info within an area

end-user opened this issue · 8 comments

commented

It would be helpful if there was a way to get the amount of biome within a given area. The way I'd imagine this working is specifying an area, a cube or square, centered on the player. As the player moves about, info listing the different biomes is displayed and updated, probably as a percentage. This would probably be a scarpet script. I'm guessing the biome info is stored per block, so that might mean each block in the area has to be queried. If the performance is poor then it might have to be one-time execution rather than dynamic. Especially if requesting a large area, like biome percentages in 128 block radius.

commented

Since in the overworld there can only be a biome per column of blocks, you would actually only need to check one block per column. Probably this could be done by creating a biomes map, where you would put each new found biome if it doesn't exist yet, or would add one to that entry if present. Then just print the map. Or to process percentages, just sum all those values and then do the standard division.

If in the nether, then yes, you would probably need to check every block.

commented

And you just made me start a complex app to do that. Unbelievable.

commented

If it helps, my use case is searching for good places to build a river biome drowned farm - more river more spawns. Count of all biomes at a given Y level would be more efficient processing. But if 3D biome generation is on the horizon a big complex app wouldn't be wasted on just one dimension.

I also have seen oddities when trying to trace biome edges. I think it may not be 100% vertical, but I'm having trouble proving it.

commented

It's done! I'll PR it to the app store Soon™, but until then, you've got it here.

You can do /biome-scanner (or whatever name you choose to call it) to see the options, but the basics are:

  • Run /biome-scanner toggle to toggle
  • Run /biome-scanner radius <radius> to change radius. Default: 64 (4 chunks each direction)
  • Run /biome-scanner display <mode> to change display type. Default: Graph (Options: graph, list or raw)
  • Run /biome-scanner netherprecision <precision> to change the precision in the nether to 1/<precision>. Default: 32 (1/32)

Preview:

2021-01-25_19 44 40

Note: The app will throttle itself down while in the nether, since because of the vertical biomes, it will check more blocks. The precision control will remove lag, but won't change the throttling.

In case you don't know how to install apps (since the wiki is a tiny bit outdated), you have two ways:

  • Download the app into the .minecraft/config/carpet/scripts folder
    • Doing it this way it will be available in all your singleplayer worlds, and it won't be loaded automatically
    • To load it, just run /script load biome-scanner, and the command will appear in your game
  • Download the app into your world's scripts folder
    • Doing it this way, it will only be able on that specific world, and it will be autoloaded whenever you load the world
    • You can still load/unload it manually if you want

The app's preview link (it's rc1, following Mojang's version specs): https://gist.github.com/altrisi/b2bdb063c77556737ee7658a78cdc1b1

(the way to download: Click "Raw" (top-right), and then Right Click > Save as...)

commented

Was thinking about making a "hologram-in-front-of-you" mode, but thought it would be too much.

commented

Almost ready, will probably send it later today.

commented

Is this what you were looking for?

commented

Yeah! This looks perfect! I'll have to give it a try. Thank you doing this!