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
It is a bit more complected than just that. I'll not go in to all of the details. What needs to happen, is each structure be loaded via world edit, copied with the player at a proper y level (ground level for ground structures, top for floating structures), then the schematic needs to be re-saved. This is a bit tedious, and I will really try to get this adjusted in the next few weeks.
Are you still having issues with the flying islands thing? I would suggest a modification to where when one randomly occurs it will only spawn in block 0 "also known as air" in the game and not grief the landscape.
Perhaps also enabling the island to spawn 50 - 100 blocks above any bellow blocks as well as only replacing air blocks, but making it not spawn to high to where it half spawns at height limit and the rest doesn't spawn because the height limit was in the way and didn't let the rest of it spawn.
I am not an expert or really anything with coding, just giving a suggestion that may or may not help.
-web
@ArchmageInc
For the flying islands I just copied yours, IDK how they work. Don't they just have to spawn at certain hight?
@jacob_vejvoda
You mean 1 layer of dirt downward from where you copied them? What about the floating islands? How many do not have the offset on the "ground plane?"
I opened most of your schematics and fixed them so there was not more than 1 layer of dirt. Also I got a ton more.
@jacob_vejvoda
What most likely needs to happen is the y offset in the schematic file needs to be moved to the bottom of the structure and not 100 blocks below it. This didn't matter when the system didn't care about the offset as it just used the structure itself and arranged it accordingly. The problem with that was if a structure had a portion that should be underground, it would put the very bottom of it at ground level.
This means I will have to load every schematic file and re-copy and save them all... ugh.
@ArchmageInc
Giant flying castles are spawning half in the ground:
I just assumed it was because of a too low hight level.
@KoroEDM
There was a change made to account for a structure's ability to extend below the ground. Because of this, the system is now aware of the offset within the schematic files. This is most likely the cause of the problem. The floating islands suffer from the same problem. What structures specifically are being pasted in the ground? The other possibility, which would only happen if the included structures.json were edited, is that DIRT or STONE were added to the trump list.
Yeah it is placing items without doing a check first I guess? It's started spawning encounters in really ugly places lol, cutting huge squares of air into the land. Sadly I'll have to uninstall. :(
This is an awesome plugin, really. But, some of the default encounters are weird. Like, the flying ones will spawn above the 256 block height limit and be half cut off, or the flying islands will spawn half in the ocean and literally create huge rifts in the seas making it REALLY ugly.
@jacob_vejvoda
Yeah, it shouldn't do this because it is not required when using treasureGroups, I can see there are a lot areas where this could cause a problem. I will have to put a fix in the code. In the meantime, you just have to put a number in there.
@ArchmageInc
Ok, so the problem is if I don't have a min and max value on my group it crashes.
@pnbamania
What version of WorldEdit are you using?
EDIT: I have done some research and it looks like this requires WorldEdit 5.5.8 or better.
@jacob_vejvoda
This is caused by a bad Treasure configuration. You are missing a min value. Please post errors in the ticket system. I will need to put a fix in place to better handle this as it is not required for treasureGroups.
@jacob_vejvoda
[12:16:31 WARN]: [RandomEncounters] Task #32 for RandomEncounters v0.3 generated an exception java.lang.NoSuchMethodError: com.sk89q.worldedit.CuboidClipboard.getBlock(Lcom/sk89q/worldedit/Vector;)Lcom/sk89q/worldedit/blocks/BaseBlock; at com.archmageinc.RandomEncounters.Tasks.StructurePlacementTask.checkBlock(StructurePlacementTask.java:70) [?:?] at com.archmageinc.RandomEncounters.Tasks.StructurePlacementTask.firstPass(StructurePlacementTask.java:179) [?:?] at com.archmageinc.RandomEncounters.Tasks.StructurePlacementTask.run(StructurePlacementTask.java:114) [?:?] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:58) [spigot.jar:git-Spigot-1223] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) [spigot.jar:git-Spigot-1223] at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:583) [spigot.jar:git-Spigot-1223] at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:273) [spigot.jar:git-Spigot-1223] at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:540) [spigot.jar:git-Spigot-1223] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:446) [spigot.jar:git-Spigot-1223] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot.jar:git-Spigot-1223] [12:16:31 INFO]: Usage: /re <place,check> <EncounterName> <world> <x> <y> <z>
Here is the error I get: http://pastebin.com/Js1n9Ti0
@jacob_vejvoda
1) What do you mean the game crashes?
2) Having a min and max with a probability of 1, might as well just have the min=max
Aside from that, I don't see a problem with the treasures configuration you posted.
I made this regstuff group but when I use it the game crashes: http://pastebin.com/qvLR1fUt
Can you tell me whats wrong?
It allows you to say I want 1-3 sets of 1-4 apples. Meaning the overall minimum would be three and the overall maximum would be 12. It just gives more flexibility especially when defining specific / rare items.
So like this: http://pastebin.com/ju8FEyen
But what is the min/max and probability for when the items I am point to already have those?