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
-
View User Profile
-
Send Message
Posted Feb 1, 2014I have oitlined the definitions of the configurations in the description above. I hope to develop a configuration builder to simplify the process of designing encounters in the near future.
For now, use the same methodology as the mobGroups, which does exist in the included configuration files.
-
View User Profile
-
Send Message
Posted Feb 1, 2014@ArchmageInc
What example? The treasures.json that came with it doesn't have any treasureGroups defined.
-
View User Profile
-
Send Message
Posted Feb 1, 2014-
View User Profile
-
Send Message
Posted Feb 1, 2014@ArchmageInc
I got: [RandomEncounters] [v0.3]: Invalid Treasure configuration: java.lang.String cannot be cast to org.json.simple.JSONArray
With this treasures.json: http://pastebin.com/1sLRQkKP
and this encounters.json: http://pastebin.com/EfU0cS9y
-
View User Profile
-
Send Message
Posted Feb 1, 2014If that is in the encounter config, yes. Every chest will be populated based on the probability set in the foodstuffs treasure config.
-
View User Profile
-
Send Message
Posted Feb 1, 2014@ArchmageInc
So if I have:
All the treasures with the group "foodstuff" will be able to spawn?
-
View User Profile
-
Send Message
Posted Feb 1, 2014@jacob_vejvoda
No, if it is null for the encounter, no treasures will be placed. The treasureGroup tag in the Treasures configuration operates the same way the mobGroup tag works for mobs. It allows you to define individual items, and have sets of those items in a group. Almost all other tags are ignored if the treasureGroup tag is defined.
For example:
You have a specific set of currency, Geordian Coins. 1 - 10 maybe. That is defined in a treasure as GeordianCoins. Then You have some other stuff, like diamonds, emeralds, etc... You can define a treasureGroup that contains 1 GerdianCoins, and 1-4 of the other stuff.
It will ignore recursion within a treasureGroup, so you can't say a treasureGroup contains this Treasure, otherwise it would loop indefinitely.
-
View User Profile
-
Send Message
Posted Feb 1, 2014@ArchmageInc
Then whats the point of the group tag?
So if I have:
On a encounter the chest will be full of random loot defined in the treasures.json?
-
View User Profile
-
Send Message
Posted Feb 1, 2014Yes. Any chest found in the structure will run through the probability distribution to place the items. So if the probability is 1, or the minimum is 1, every chest will have that item.
-
View User Profile
-
Send Message
Posted Feb 1, 2014@ArchmageInc
How do the treasures work? All the items in the treasures config can spawn in any chest?
-
View User Profile
-
Send Message
Posted Feb 1, 2014@jacob_vejvoda
Good call. The new file should have it now.
-
View User Profile
-
Send Message
Posted Feb 1, 2014The new download doesn't come with a treasures.json and when I re-boot the server one is not created.
-
View User Profile
-
Send Message
Posted Feb 1, 2014Okay, so I have uploaded v0.3 which stops the plugin from locking up the server. If a player is near a structure during creation, it will back down and construct it slower. This stops it from flooding the client with too many updates.
I want to adjust the encounters so it is more congruent and I think we are pretty close to the official release.
Anyone testing this, please post any errors in the ticket system so they can be ironed out before the release.
-
View User Profile
-
Send Message
Posted Jan 30, 2014@ArchmageInc
Yes, as my edit said I posted before I got your PM.
OK, I will.
-
View User Profile
-
Send Message
Posted Jan 30, 2014Yeah having a treasureGroup or named treasures should be a feature. Please add it to the ticket system.
-
View User Profile
-
Send Message
Posted Jan 30, 2014@jacob_vejvoda
The error you pasted was the same as before. A mob in the encounter config, does not match the name in the mob config. This should be fixed in v0.3.
-
View User Profile
-
Send Message
Posted Jan 30, 2014@jacob_vejvoda
You do not have to have expansions. If you omit the expansions directive, or set it to null. It won't check for expansions. Please post errors in the ticket system.
-
View User Profile
-
Send Message
Posted Jan 30, 2014Can you make an option to just disable expansions?
Also whats this error: http:pastebin.com/TyGaWqXs It didn't show up on server start-up, it takes a while the eventually pops up.
EDIT: ok got ur PM, and it showed me the error!
PS: Did you see my post:
"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."
-
View User Profile
-
Send Message
Posted Jan 30, 2014Okay, so in v0.3 I have moved location checking to a task based system. This way location checks will not lock the main server thread for long periods of time causing players to be disconnected. The problem with this is it takes a lot longer to perform location checks. My tests show on average, about one minute per chunk. So, if an encounter expansion is set to a distance of 1, it will check a total of 4 chunks, so the duration should be at least 4 minutes. At a distance of 2, a total of 16, 3:36, 4:64 and so on (2n)^2. I hesitate to enforce this rule.
Right now, I am not happy with the order in which it checks expansions. It will more often expand in a -x,-z direction. I want to add more logic or perhaps randomness into this. Right now though, I am struggling to find a better way.
I have also added a fix for the NPE with a misspelled material.
-
View User Profile
-
Send Message
Posted Jan 30, 2014@ArchmageInc
As soon as you add checks to tell me actuality what caused the error can you pm me the binary?
I keep getting errors and I have no idea how to fix them.