- check_circle Functions
- 7,655 views, 2 today
- 226 downloads, 0 today
9
Biome Detection Utility v1.6
by QuaccDaddy
A utility datapack for other map-makers, so they can run functions to detect biomes in their mods/maps.
Before 1.14, biome detction was a much desired ability for datapacks, but it was never easy or 100% accurate.
Now, with the new loot table abilities, this datapack make it as simple as running a function and checking a scoreboard.
This could be used to make biome-specific mobs, biome-specific structures, just about anything you can think of.
When the scan_biome function is ran, it will detect what biome it was executed from and set the following scores:
biomeID : The minecraft id of the biome Java Edition data values – Official Minecraft Wiki
snowyBiome : 1 if snowy, 0 if not
coldBiome : 1 if cold, 0 if not
temperateBiome: 1 if temperate, 0 if not
warmBiome: 1 if warm, 0 if not
aquaticBiome: Currently contains all oceans and rivers, but can be edited easily in the code
mountainousBiome: 1 if mountainous, 0 if not
biomeRealm : 0 for overworld, -1 for nether, 1 for end
All of the scores listed above besides biomeID are regarded as groups, and there is a template for making your own group inside the files incase you have a set of biomes that is not listed.
How to use:
When you first run it, type /function biome_det:install and all scoreboards should be ready.
From there, you can type /function biome_det:scan_biome and the proper scores will be set for that entity.
All data will be set to display as a default.
You can disable displaying the biome with /function biome_det:display/biome_disable
You can disable displaying the biome data with /function biome_det:display/biome_data_disable
It's that simple!
In the pictures here, you can see the functions being showcased in chat.
If you are using this in your own datapack or mod and wish to remove the chat message when installed, that can be removed from within biome_det:install and biome_det:uninstall.
Warning: If you decide to run this function every tick for many entities at once, you will likely experience lag. It is best to either run for a few entities at a time, or to delay the scan every 20 ticks or so.
by QuaccDaddy
A utility datapack for other map-makers, so they can run functions to detect biomes in their mods/maps.
Before 1.14, biome detction was a much desired ability for datapacks, but it was never easy or 100% accurate.
Now, with the new loot table abilities, this datapack make it as simple as running a function and checking a scoreboard.
This could be used to make biome-specific mobs, biome-specific structures, just about anything you can think of.
When the scan_biome function is ran, it will detect what biome it was executed from and set the following scores:
biomeID : The minecraft id of the biome Java Edition data values – Official Minecraft Wiki
snowyBiome : 1 if snowy, 0 if not
coldBiome : 1 if cold, 0 if not
temperateBiome: 1 if temperate, 0 if not
warmBiome: 1 if warm, 0 if not
aquaticBiome: Currently contains all oceans and rivers, but can be edited easily in the code
mountainousBiome: 1 if mountainous, 0 if not
biomeRealm : 0 for overworld, -1 for nether, 1 for end
All of the scores listed above besides biomeID are regarded as groups, and there is a template for making your own group inside the files incase you have a set of biomes that is not listed.
How to use:
When you first run it, type /function biome_det:install and all scoreboards should be ready.
From there, you can type /function biome_det:scan_biome and the proper scores will be set for that entity.
All data will be set to display as a default.
You can disable displaying the biome with /function biome_det:display/biome_disable
You can disable displaying the biome data with /function biome_det:display/biome_data_disable
It's that simple!
In the pictures here, you can see the functions being showcased in chat.
If you are using this in your own datapack or mod and wish to remove the chat message when installed, that can be removed from within biome_det:install and biome_det:uninstall.
Warning: If you decide to run this function every tick for many entities at once, you will likely experience lag. It is best to either run for a few entities at a time, or to delay the scan every 20 ticks or so.
Compatibility | Minecraft 1.14 |
Tags |
2 Update Logs
Update #1.6 : by Quacc Daddy 06/07/2019 10:25:52 pmJun 7th, 2019
Added tellraw display thanks to suggestion from Mouleagauffre.
Directly zipped files, also thanks to Mouleagauffre.
Added function for displaying data and editing what is displayed.
Corrected Help function. (Now has links to each command)
Improved Custom Group Template.
Added full biome list with id's in folder.
Directly zipped files, also thanks to Mouleagauffre.
Added function for displaying data and editing what is displayed.
Corrected Help function. (Now has links to each command)
Improved Custom Group Template.
Added full biome list with id's in folder.
LOAD MORE LOGS
tools/tracking
4309106
119
biome-detection-utility-v1-4
Create an account or sign in to comment.
I'll use this in one of my creations (while giving credit of cause :) )!
But I had one problem (tested in 1.15.2):
When scanning for a biome, I got no results at all. This was, as I found out later, because the bat that dropps the sea pickle (why did you choose a sea pickle? ;) ) was higher than 255 (at 355 or so). That means, the bat does not spawn inside of a biome, as the biome value only goes up to 255.
I fexed that by making the bat spawn at 254 instaed.
But still, an amazing creation! Thanks!
The problem you had is a good point that I overlooked.
Although, I will not update this datapack as 1.15 has introduced predicates to code which will change how this is done significantly and biomes are detectable with a simple command in the game using the predicates!
I picked sea pickles just to have some weird goofy things going on that only people who look into the code would notice lol.
In addition to setting the nbt tag:{Biome:"Ocean"}, add tag:{BiomeID:0s} to the loot table, where 0s is the corresponding ID.
This way you don't have to check the nbt to set the biomeID score. You can just "/execute store" the value. That would cancel out about 200 lines in the scan_biome funcition and make it a bit easier to maintain.
Thank you for the suggestion, though!
Very clever :D
- First you should directly zip together your data folder and your pack.mcmeta file, so we will not have to extract the zip to use the datapack.
- secondly you should display the result of each scan in the chat using a tellraw, it will prevent user from display each scoreboard one by one.
example: