Jump to content

Recommended Posts

Posted (edited)

What is the best way to generate structures bigger than a chunk? Are there tutorials for it?

I've looked it up online and I know that WorldGenerator shouldn't be used for things bigger than a chunk, and I've seen that the bigger structures in minecraft like strongholds and the woodland mansion have chunkproviders, but I haven't found any tutorials on those.

Edited by GooberGunter
Posted

Use Structure Blocks. You can look at Igloos and newer Minecraft structures for example. Basically, all you need to do is build your structure, save it to NBT using Structure Blocks, and load it in through a Template.

 

If you want a structure bigger than 32x32, you can make multiple Structure Blocks and when you spawn the structure in you can the multiple files in and just offset positions depending on the piece. I have some code on my GitHub as well using Structure Blocks.

Developer of Levels and Lost Eclipse

Posted

Yes - instead of having a bunch of setBlockState calls specifying every single block in your structure, you can load your structure from NBT in a very few lines of code. Just call the template method to set the blocks in the world in your WorldGenerator class.

Developer of Levels and Lost Eclipse

Posted
4 hours ago, TheXFactor117 said:

you can load your structure from NBT in a very few lines of code

And that "structure" can include the air you want as a buffer around and/or above.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted
On 7/15/2017 at 8:14 PM, TheXFactor117 said:

Use Structure Blocks. You can look at Igloos and newer Minecraft structures for example. Basically, all you need to do is build your structure, save it to NBT using Structure Blocks, and load it in through a Template.

 

If you want a structure bigger than 32x32, you can make multiple Structure Blocks and when you spawn the structure in you can the multiple files in and just offset positions depending on the piece. I have some code on my GitHub as well using Structure Blocks.

Is this method also supported in 1.10.2? If so, can I still have some randomization in structures?

Posted

Yes, I believe structure blocks were added in 1.10.

 

As for randomization, what exactly do you want randomized? One draw back of loading from NBT that I found is you can't change the blocks that are saved in the NBT. I haven't looked into it too much though, so there might be a way. You can use Data Blocks to put on top of chests or other important blocks to load loot tables for example too.

Developer of Levels and Lost Eclipse

Posted (edited)
10 hours ago, TheXFactor117 said:

You can use Data Blocks to put on top of chests or other important blocks to load loot tables for example too.

 

Edit: can you use them for mob spawners?

Edited by GooberGunter
Posted

You don't need a structure class. Create a Template variable which loads your NBT file through a ResourceLocation. Once you have a template, just call addBlocksToWorld or whatever the method is called.

Developer of Levels and Lost Eclipse

Posted

When saving your structure, place a monster spawner (the default one) and place a data block on top of it and name it like monster_spawner or something. When you add the blocks to the world, you can call a method which will handle the data blocks. Here is my method for handling data blocks for an example.

 

Essentially you just need to loop through all data blocks in the structure - if the data block name matches the one you are looking for, you can do stuff with the block underneath. For example in my structures, I'm setting the loot table for the chest. For monster spawners, you can get an instance of the Tile Entity and modify it there. After you are done modifying it, simply set the data block to an air block or whatever block you want (or else it'll spawn a random block based on where it is located).

  • Like 1

Developer of Levels and Lost Eclipse

  • 1 year later...
Posted
On 7/16/2017 at 2:14 AM, TheXFactor117 said:

Use Structure Blocks. You can look at Igloos and newer Minecraft structures for example. Basically, all you need to do is build your structure, save it to NBT using Structure Blocks, and load it in through a Template.

 

If you want a structure bigger than 32x32, you can make multiple Structure Blocks and when you spawn the structure in you can the multiple files in and just offset positions depending on the piece. I have some code on my GitHub as well using Structure Blocks.

Hey TheXFactor, did you move the code to somewhere else?  I wanted to look at some code examples with multiple structure blocks in only one structure but the link that you posted is no longer available. 

Do you know other tutorials/code that can help me?

Posted
10 minutes ago, JDL said:

Hey TheXFactor, did you move the code to somewhere else?  I wanted to look at some code examples with multiple structure blocks in only one structure but the link that you posted is no longer available. 

Do you know other tutorials/code that can help me?

He still has some old tutorials posted on GitHub: https://github.com/doctorhealt3/TheXFactor117s-Forge-Tutorials/blob/master/OldTutorials.md but I can't find anything relevant to this topic. 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.

Guest
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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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