RandomEncounters
Overview
Tired of seeing the same old villages? Wish there was a way to add configurable encounters to the world? This is the problem Random Encounters aims to fix. From portal temples on the overworld with their Blaze leader and a horde of mad zombie pigmen gated in from the nether to common farms. Each encounter is configurable including the probability of the encounter, to the encounters eventual expansion, to the probability of each treasure item in chests or on the mobs.
Features
- Add encounters to the minecraft world
- Configure hostile mobs
- Configure encounter treasure
- Configure encounter growth
- No more are there just plain old villages
- Allows the placement of large structures without lagging the server
Dependencies
Configuration
Plugin Configuration
debug
The Debug section is designed to help developers in identifying how the plugin is operating to aid in-game verification and help troubleshoot the plugin during development.
- midas [Boolean] (default: false) King Midas was known for turning everything he touched into gold. This debug mode turns the surface area checked into gold to spot invalid encounter placement areas
- loglevel [Integer] (default: 0) This debug option tells the plugin how much information to output.
maxLockTime
[Integer] (default: 10) This is the maximum number of milliseconds any task will lock the server for processing.
structureConfig
The structureConfig option is a string of the file name containing the structure configurations in JSON format. The default value is structures.json.
{
"structures": [
{
"name": "(String) Unique structure name",
"file": "(String) Schematic file name including directories",
"minY": "(Integer) Minimum Y coordinate to place the structure",
"maxY": "(Integer) Maximum Y coordinate to place the structure",
"trump": [
"(String) MaterialName of over writable material",
],
"invalid": [
"(String) MaterialName of invalid foundation material",
]
},
],
}
mobConfig
The mobConfig option is a string of the file name containing the mob / creature configurations in JSON format. The default value is mobs.json.
For more information on the mobs.json visit:
Mob Configuration Options
treasureConfig
The treasureConfig option is a string of the file name containing the treasure / item configurations in JSON format. The default value is treasures.json.
{
"treasures":[
{
"name": "(Sring) Unique treasure name",
"material": "(String) MaterialName",
"tagName": "(String) Item Name",
"min": "(Integer) Minimum",
"max": "(Integer) Maximum",
"probability": "(Double) Probability",
"treasureGroups": [
{
"name": "(String) Treasure name for group",
"min": "(Integer) Minimum number to generate",
"max": "(Integer) Maximum number to generate",
"probability": "(Double) Probability of additional groups"
}
],
"enchantments": [
{
"enchantment": "(String) EnchantmentName",
"probability": "(Double) Probability",
"level": "(Integer) EnchantmentLevel"
},
]
},
],
}
encounterConfig
The encounterConfig option is a string of the file name containing the encounter configurations in JSON format. The default value is encounters.json. The encounter configuration file is what ties Structures, Mobs, and Treasure all together.
{
"encounters": [
{
"name": "(String) Unique Encounter Name",
"enabled": "(Boolean) should new encounters be generated",
"probability":"(Double) probability of occurrence",
"structure": "(String) Structure name from defined structures",
"mobs": [
"(String) Mob name from defined mobs",
],
"validBiomes": [
"(String) Biome name",
],
"invalidBiomes": [
"(String) Biome name",
],
"treasures": [
"(String) Treasure name from defined treasures",
],
"expansions": [
{
"encounter": "(String) defined Encounter name",
"probability": "(Double) probability of expansion",
"duration": "(Integer) Duration in minutes to check ",
"max": "(Integer) maximum number of expansions",
"distance": "(Integer) maximum distance in chunks"
},
]
},
]
}
Commands
re reload
Reloads the JSON configuration files. Keep an eye on the console for errors
re place <encounter> [<world> <x> <y> <z>]
Forces an encounter to be placed at the player's current location or the location specified. This does not perform terrain checks. The console command must specify the coordinates
re check <encounter> [<world> <x> <y> <z>]
Forces the system to check the current chunk, or the chunk containing the specified location to place an encounter. This performs terrain checks and places the encounter if a suitable location is found. The console command must specify the coordinates
re radius <encounter> <radius> [<world> <x> <z>]
Forces the system to check all chunks in a specified radius of chunks from the current player location or the location given by the specified chunk coordinates. The console command must specify the chunk coordinates
Installation
- To install the plugin, extract the contents of the zip file into your plugins directory.
- Default encounters are included in the RandomEncounters folder.
Bugs / Known Limitations
Because of the vast nature of this plugin, please use the GitHub Issue tracking system to submit bugs, issues, and feature requests.
GitHub Issue Tracking
Structure Contributors
@jacob_vejvoda
This was caused by an invalid material when it tried to create the item. I am not seeing what in your config caused the problem though.
I really appreciate your helping beta test this plugin, but we should probably keep this thread somewhat clean. Please paste these errors in the issue tracker and we can have these conversations there.
NVM, It was a typo in a item name definition, you should add a check for that in start-up.
Also for the treasures you should make a treasures.json so I can have certain groups of treasures used for multiple encounters, right now I have copy-paste it a trillon times.
@ArchmageInc
I got this error when I tried to add items:
Here is my encounters config: http://pastebin.com/XkcJrHND
@jacob_vejvoda
The treasure configuration option for the encounter is exactly that. This is the configuration that will be used for every chest found in the structure. I have not run a lot of tests on this yet, so please let me know what you discover when using it.
@ArchmageInc
What is the loot option for in the encounter? Dose it spawn items in the chest in encounters? If it doesn't can you add a way to?
@idy26
I do have a test server, though I hate to publicly advertise it. With this being in beta and constantly making changes to it, the server is not reliable. I am terrible at videos and I want to focus on cleaning up the plugin before I go through all the effort of what it does and how it works. A lot of that is still being flushed out :) I will try to throw some better instructions and multimedia together when I feel it is ready for release.
@ArchmageInc
Would you happen to be running a test server and/or have a video of the plugin's effects?
What this is saying is when it tried to create the placed encounter, one of the mobs were null in the encounter configuration. This means when the encounter was loaded from the json, the mob name for it did not match any of the defined mobs in the mobs json. I thought this should issue an error to the console on startup and softly ignore it. I'll need to get a fix for that in v0.3. In the meantime, make sure all the names match up.
First of all I am subscribed to your plugin so I got the download even though they declined it. Also that was the start-up error.
EDIT: Is there anything new in the new 0.2 upload?
I just re-created the error:
On server start:
Later when a encounter is generating:
@jacob_vejvoda
What version are you using? v0.1 PlacedEncounter line 184 is not where this error happened. v0.2 was declined because I accidentally built the jar with the schematic resources in it. But, if you are using v0.2, a mob was null, meaning the mob definition in the encounter didn't match what was in the mobs configuration file. This should have spawned an error when you started the server. Did it?
How do I know whats causing the errors like this:
@jacob_vejvoda
Through the expansions configuration option in the encounters.json file, you define the probability, wait time, distance, and expansion encounter for encounters.
For example: You setup a house encounter, with a house structure. If it is placed in the world, maybe once an hour the server checks to see if the house should spawn a farm nearby.
This is one of the strongest portions of this plugins. Care must be had when defining this expansion because if the probability is too high and durations are too low, it will quickly overwhelm the server, which is what I meant previously by the server ran away with the spoon. The full Overviewer map of this exercise can be seen here: The Server Ran Away With The Spoon
It generated over 3,500 encounters.
@ArchmageInc
Expand? How do encounters expand?
@jacob_vejvoda
No, it does not mean that the structures will disappear. It only means that the encounter is no longer allowed to expand. It cannot be disabled at the moment, but I am open to other ideas concerning sacking encounters.
Dose "Sack Encounters when all Mobs die" mean the structures will disappear? Can I disable it?
I have uploaded v0.2 for the Beta. It adds a lot more configuration options and cleans out some of the bugs.
v0.2 also redefines the included encounter configurations. If you are upgrading to v0.2 and want to keep your existing encounters you will need to merge your encounter configurations with the ones included here. Also, be sure not to wipe out your saveEncounters.json or it will forget it placed the encounters.
I appreciate everyone's help in identifying limitations, bugs, and feature enhancements. Please use the ticket system to report these and I will do my best to get to everything. Obviously I have my own goals and aspirations for what this should do, but if I can make an adjustment to help someone else better use this, the better.
@jacob_vejvoda
Not at this time. Since this is still in Beta, I am constantly restarting the server. I would like to add commands to help in management. Please create an issue in the ticket system to help track these requests.
@ArchmageInc
Ok, thanks I didn't know about the structures.json Also is there a command to reload the config and .json files without restarting the server?
@jacob_vejvoda
So first, partially underground structures have been a problem for me. You can set DIRT in the list of blocks that can be overwritten and it will place them underground, just not stone. The problem with this is it won't always line up. What I have tried to do, is use the origin vector of the schematic file to define a sort of placement plane. It isn't working quite properly yet.
As for the error:
At first, I thought this was similar error I ran into with v0.1 where the ChunkPopulateEvents were compounding and causing problems. What you have provided looks like a failure to get the structure from the encounter. Were there any errors during startup? I will put a safety in place to prevent this in the future. In the meantime make sure the encounters.json's references to structures.json's structure definitions. It does bring up the point that I need to build a mechanism to have encounters with no structures.
OK, so do the structure always spawn on the ground? or can they spawn a bit in/fully in the ground?
Also after adding some encounter and mobs I got this error, what dose it mean: