👾Sample Custom Rules
Below are a collection of sample Custom Rules which you can implement into your LevelledMobs4 Rules file. Each rule provides a general description of what it accomplishes, and how you might use it on your own server.
Deny a Level to Specified Mobs
This rule has a
conditions
check for the specifiedentities
, usingincluded-list:
to specify individual mob types (withBABY_
representing all Baby type entities), andincluded-groups:
to specify a universal mob group of entities.
Custom Mob Stat Changes
This rule provides a custom set of attribute modifiers for the Ender Dragon mob.
Use Boss-Bar Style Health Indicators for Nametags
This custom rule lacks a condition, so it would apply to any mob which was levelled at the point of this rule taking place; you can add your own
conditions
to limit this.
Unique Mob name based on it's level
This custom rule would give a unique name to entities based on their level. This rule applies to all mobs, though you can instead specify individual mobs.
A Custom Rule for External Plugin Mobs
For any 3rd party mob plugin supported via the
externalplugins.yml
or any other internally supported 3rd party mob plugin can be conditioned against, and then you can apply any set of unique rules to those type of mobs. You can further narrow the conditions by the entity type, or custom name, etc.
Nerfed Spawner Cube Mobs
This custom rule will listen for any mob which was spawned from a vanilla Spawner Cube. These mobs will be given a prefix to their name,
Spawner
, and given altered stats in order to prevent any common player farms from breaking.
Modifying Construct-Level for new Strategies
When you need to create a new levelling strategy for a mob, it needs to be given a new construct-level:
if the changes made do not fit into the previously established construct-level:
, likely from the default-rule:
.
The Startled Creeper | Requires NBT-API Plugin
This rule utilizes a compatibility with the 3rd party plugin NBT-API.
This will, at a 10% chance, apply custom NBT data to Creeper mobs. This custom NBT alters their view distance and fuse timer, making both very short. This means that the Creeper will not recognize the player unless they are nearby, and if they do recognize the player they will explode using a shorter fuse timer than normal.
Using Drop Tables from Custom Rules
This custom rule will apply the
drop-table
'sname-of-table
andother-table
.These tables are referenced in the
customdrops.yml
Using Custom Placeholders with the Player Variable Modifier
This custom rule utilizes the player variable modifier (PVM) and the construct level mechanic to alter the level applied to mobs. The Construct Level generates a number based on the Player Variable Mod settings, and that is added to a random number from -5 to 5.
Limit a custom rule to specified WorldGuard region
This rule would check if the mob spawned in the specified WorldGuard region, and if so apply the settings specified.
Limit a custom rule to Specified Coordinates
These are several examples of how to use the
within-coordinates
conditions when isolating a specific set of coordinates or a region of coordinates for which a custom rule would be applied.
In the first sample you can see an example of how to specify a specific point or coordinate by specifying the
start-
coordinate for each of thestart-x
,start-y
, andstart-z
conditions. By not specifying theend-
coordinate, that condition is automatically populated with the same value as it's correspondingstart-
. This means, in the example, the rule would only apply to the coordinate location (50, 64, 50). This might be useful for specifying a special command block or spawner cube that generates entities in an always specific location.
In the second sample you can see an example of how to specify a straight line of coordinates. We specify the
start-x
andend-x
, with thestart-y
specified. Using the same logic as mentioned above, we have thestart-y
set but not theend-y
, so those values will be equal. Since we've specified astart-x
andend-x
, then that means anyX
coordinate value between those two set numbers would be valid. This means, in the example, the rule would only apply to entities spawnedy=64
and anyX
coordinate betweenx=50
andx=75
. This would create a line betweenx=50
andx=75
at they=64
height; removing thestart-y
would create the same effect at any height, thereby creating a 2D plane of coordinates at any height rather than a line.
In the third sample you can see an example of how to specify a 2D plane of coordinates. We specify a
start-x
/end-x
andstart-z
/end-z
, with thestart-y
specified. With both theX
andZ
coordinate ranges specified, that means any coordinate between thosestart-
andend-
of each coordinate type will be valid. Since we specified aY
coordinate, that generates the 2D plane; removing thestart-y
would create the same effect at any height, thereby creating a 3D cuboid of coordinates at any height rather than a 2D plane.
In the final sample you can see an example of how to specify a 3D cuboid of coordinates. We specify all three of the
start-
andend-
coordinate types, meaning that any value between thosestart-
andend-
values would be valid. In the example that would generate a cube with one corner of (50, 64, 50) and the opposite corner being (75, 90, 75).
For all of the
end-
options, you can specify the value of+
or-
. These values simply represent 'all numbers above' or 'all numbers below' the correspondingstart-
value. As well, you can specify negative numbers for allstart-
andend-
values. Finally, a reminder that any value that has astart-
specified but not the correspondingend-
will have theend-
populated with the same value asstart-
, creating a single-point coordinate. If neither correspondingstart-
orend-
is specified (example beingstart-y
andend-y
together), then that coordinate type will not be checked against when considering the entities' location.
Syncing Levels from Overworld to Nether
The idea behind these series of custom rules is to arrange a levelling system which applies a single level every 1000 blocks from a centerpoint using the distance from origin levelling strategy in the Overworld. Then, it says that the level will increase one level every 8 blocks downward from the sea level in Minecraft, established at y=64 blocks. This increase continues downward until the player reaches the Minecraft bedrock level at y=-64 blocks. This gives us an increase of a maximum of 16 levels from the y=64 to bedrock. That means that, at the centerpoint itself, the highest level I should encounter at bedrock would be level 17; 1 level for the distance, and 16 additional for the depth.
We then establish a similar levelling structure for the Nether, using known information about the Nether to compensate for the difference in the Overworld. For example, every 1000 blocks in the Overworld would only represent 125 blocks in distance within the Nether. If we want to presume that the Overworld is 'on top' of the Nether and that the level would continue to increase from the base of the Overworld to the ceiling of the Nether, then we need to include those added 16 levels we gained from the second custom rule downward 'into' the Nether realm custom rule. We do that by artificially subtracting those 16 levels worth of distance from the Nether formula, so that the mobs at the ceiling are already starting with an additional 16 levels.
The Nether ceiling is officially at y=127, and the Nether floor is officially y=0. If we continue the 'every 8 blocks' we increase in level, then we have nearly another 16 levels to add at the end of the Nether.
Last updated