Discussion in 'Plugin Development' started by xxNightlordx, Nov 15, 2012.
Is it possible to make a plugin that generates random structures, such as a castle?
The short answer is yes. The long answer is yes.
Probably by hardcoding into your plugin "blueprints" of the structure. You could do this by setting blocks to air/stone/dirt/etc. one at a time. For massive structures, this would take forever...
Alternatively, you could use for loops to loops through massive locations and change the blocks. Again, this would still take an incredible amount of time.
If you want it to automatically generate the castles you would have to change the terrain generator.
Simplest way is to do what SgtStud suggested - create a blueprint of several types of castles beforehand and just "randomly" select one of these.
Alternative, and much more difficult, is to write an algorithm that will build something for you using pre-defined rules. It's complicated, and if you're asking this question, it's probably a little too difficult for you to even consider yet. Try the pre-defined blueprint method first.
But whats the code supposed to be? Can u provide an example or something
There is an example for a different terrain generator in the link I provided in my previous post.
Separate names with a comma.