Jump to content

[1.8.9]Changing the biome in a given location


Recommended Posts

Hello! I am creating an item that is able to change the biome type in a given location when used, however I have run into quite a few issues and am now at a complete loss. I have a few suspicions for implementation and access, but they have all led to dead ends.


It appears as though (PLEASE correct me if I am wrong) biomes are stored by chunk, however there are only accessors for obtaining information about biomes in a given chunk, no mutators. The one mutator I see is "setBiomeArray" which takes a sized 256 byte array and sets the new biome array to the one given in the method call.


1. Does setBiomeArray allow me to change the ID and information of a given chunk to a new biome and will it then have the properties of the biome like normal?

2. If so, how do I obtain a byte Array of the given type I need? If I want to change one biome into a desert biome always, how do I get the mappings of a desert biome?


I have peeked a bit at 1.7.10 Blood Magic, Random Things and Witchery to attempt to learn how they modified biomes, however I was largely unsuccessful.

Any information at all would be extremely useful. Thank you!

Link to comment
Share on other sites

What you said is mostly correct.

Get biome array from chunk, set biome at location to what you want and than set chunk's biome array to it.

If i remember correctly, to transform x and z to index in array, you have to do x << 4 | z, where x and z are internal chunk coordinates (global coordinates bitwise anded with 15).

Link to comment
Share on other sites

If you follow the World#getBiomeForCoordinates() call stack you'll see how it gets access to the biome stored at a particular coordinate.  You'll then have to write your own method(s) to change the value.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.