Toast Wiki
Advertisement

This mod allows you to customize all mobs, vanilla or otherwise, with anything that can be modified through NBT editing, plus drops and more. To top it off, many properties accept number ranges for values, and are randomized for each mob.

Everything in this mod is completely configurable. This mod will do nothingif you do not edit its properties files. The properties files are generated in your .minecraft/config directory.

The properties files use a format known as JSON (JavaScript Object Notation). You can find specs and examples of JSON on the JSON website and various tutorials scattered throughout the internet. This page will assume you understand JSON enough to write a file and know what I mean when I say "object", "array", "name", and "value".

How To Use[]

Install the mod and start Minecraft once to generate five files in your config folder:

MobProperties.cfg - the general properties for the mod.

MobProperties.json - the default properties to use when auto-generating new files.

MobProperties - the folder where all of your mob properties files are stored. Should be full of auto-generated mob properties at this point.

MobPropertiesExternal - the folder that houses all of your external functions. This will be covered more later.

MobPropertiesSchematics - the folder you place schematic files you wish to load and place in the game as mob "drops".

You probably won't need to mess with the general .cfg file. The few things inside are self-explanatory, so I won't be going over them here.

Open up your MobProperties folder (.minecraft/config/MobProperties). You will see that the mod has already generated a file for each registered entity - including any entities from mods.

You can open up JSON files with any text editor, or you can use any JSON or JavaScript program to help you write them. I recommend this online JSON editor to write your properties files with. It's simple, effective, free, and doesn't require a download.

When you open up one of the generated properties files, you'll see it has four basic parts to it: "_name", "drops", "stats", and "pre_stats". The value of "_name" is the string id of the mob the file will apply to. Only one file may exist for any string mob id. "drops", "stats", and "pre_stats" are the arrays which contain all of your function objects - they are not required, and default to empty arrays if not included.

Function objects are what alter the mob and its drops. A function object is simply an object containing the field "function" with a value equal to the string name of the function you want to use, along with any required and optional name/value pairs associated with that function.

Any function object can be used as an external function. It must be saved in its own .json file and placed in the subfolder of MobPropertiesExternal that fits its context. For example, a function that adds a drop should go in MobPropertiesExternal/drops.

Throughout the tables below, you will see some fields say (number range). This means that those fields accept single numbers as numbers or strings, or two string numbers separated by a tilde (~). Any of these numbers may be represented as hexidecimal by prefixing the hex number with "0x". A number range will randomly be one of the two numbers, or any number in between. If a fractional number is used where an integer is needed, one of the two nearest integers is chosen at random, weighted towards the closer one (e.g., "0.3" has a 30% chance to be 1 and a 70% chance be be 0). All random decisions are made on a per-mob basis (from above, "0.3" will be 1 for 30% of mobs and 0 for 70% of mobs).

You may place a comment anywhere except in arrays. To do this, just make a string field called "_comment" and for its value, type whatever you want in quotations (e.g., "_comment":"This is a comment!"). Feel free to place multiple comments in one place -the overlapping of names will not matter because comments are ignored by the mod.

Universal Functions[]

These functions can be used anywhere that functions are accepted. Universal functions are generally logicals, conditionals, or loops.

Quick Reference[]

function: required_field*  optional_field  etc.
all:      functions*  count
choose:   functions*  count
if_X:     functions*  count
external: file*  count
conditionals:
if_burning
if_wet
if_wither_skeleton
if_has_potion_X
if_check_nbt_X
if_beyond_X

if_raining
if_thundering
if_moon_phase_X
if_past_day_time_X
if_past_world_time_X
if_past_world_difficulty_X
if_difficulty_X
if_in_dimension_X
if_on_block_X
if_below_X

if_in_biome_X
if_in_biome_type_X
if_biome_temp_X
if_biome_height_below_X
if_is_humid
if_rainfall_above_X
if_temp_above_X
if_biome_temp_above_X

if_player_online_X

(drops only)
if_recently_hit
if_rare
if_rare_super
if_above_looting_X
if_killed_by_X
if_killer_on_ground
if_killer_burning
if_killer_wet
if_killer_submerged
if_killer_has_potion_X
if_check_killer_nbt_X
if_killer_wither_skeleton

if_damage_type_X
if_killed_with_fire
if_killed_with_magic
if_killed_with_projectile
if_killed_with_indirect
if_killed_with_explosion
if_killed_with_unblockable

Full Table[]

Function Description Fields (* - Required)
all Used to perform functions multiple times or to use multiple functions where only a single function is accepted. functions*: array of function objects that will all be performed when the all function is.

count: (number range) number of times to perform the functions. Default is 1.

choose Chooses only one of several functions at random, based on the weights you have assigned them. functions*: array of function objects to be chosen from - each function in this array also has the optional field weight, which is its likeliness to be chosen, and defaults to 1 for each function.

count: (number range) number of times to choose a function to perform. Default is 1.

if_X Only performs the functions under certain circumstances, based on the name of this function. (See below for a full list.) functions*: array of function objects that will all be performed if the condition is met.

count: (number range) number of times to perform the functions. Default is 1.

external Executes the function inside the external file specified. file*: the file name of the function to execute. Do not include the file extension (.json).

If Function[]

The if_X function is a function which performs exactly like the all, but does not do anything at all if its condition is not met. The condition is determined by the name you use for the if_X function.

Using an exclamation mark at the beginning of the function inverts its behavior, then only performing functions if its condition is NOT met.

Some conditions require additional input, such as if_in_dimension_X, where you must replace the X with your input (in this case, an integer).

Some conditions will always be false unless used inside the main drops section. These are noted below with (drops) at the beginning of their condition.

Functions:

function:                   condition
if_on_ground:               if the mob is on the ground
if_burning:                 if the mob is on fire
if_wet:                     if the mob is in water (including rain/snow)
if_submerged:               if the mob is under water and does not have aqua affinity
if_wither_skeleton:         if the mob is a ender dragon
if_has_potion_X:            if the mob has potion X on it (X is a potion id)
if_check_nbt_X:             if the nbt comparison is true (see below)
if_beyond_X:                if the mob is farther than X blocks from the world spawn point

if_raining:                 if it is currently raining
if_thundering:              if there is currently a thunderstorm
if_can_see_sky:             if the block has a direct view of the sky
if_moon_phase_X:            if the moon is currently in phase X (X is full, waning_gibbous, third_quarter,
                                waning_crescent, new, waxing_crescent, first_quarter, or waxing_gibbous)
if_past_day_time_X:         if the day time is greater than X (varies from 0 to 23999)
if_past_world_time_X:       if the total world time is greater than X
if_past_world_difficulty_X: if the Apocalypse mod is installed, if the world difficulty is greater than X
if_difficulty_X:            if the difficulty is set to X (X is peaceful, easy, normal, or hard)
if_in_dimension_X:          if the mob is in dimension X (X is an integer dimension id)
if_on_block_X:              if the mob is on or in block X (X is an integer block id)
if_below_X:                 if the mob is below layer X (X is an integer block height)

if_in_biome_X:              if the mob is in biome X (X is a biome's name exactly as shown in F3)
if_in_biome_type_X:         if the mob is in a biome similar to X (see below)
if_biome_temp_X:            if the biome temperature is in the X category (X is cold, medium, or warm)
                                temp ranges: (-0.5)- cold -(0.1)- invalid/cold -(0.2)- medium -(1.0)- hot -(2.0)
if_biome_height_below_X:    if the biome's base height is below X blocks (see below for standard heights)
if_is_humid:                if the biome is considered humid (normally rainfall > 0.85)
if_rainfall_above_X:        if the biome's rainfall is greater than X
if_temp_above_X:            if the temperature at the entity's location is above X (same as biome temp below 65 blocks,
                                above 65 blocks decreses by a random amount, then -0.001667 for each block above 64)
if_biome_temp_above_X:      if the biome's standard sea-level temperature is greater than X (water freezes below 0.2)

if_player_online_X:         if the player with username X is in the world

if_recently_hit:            (drops) if the mob was hit by a player in the past 5 seconds
if_rare:                    (drops) if the drop is a rare drop (1 in 40 chance if recently hit)
if_rare_super:              (drops) if the drop is a super rare drop (1 in 5 chance if rare)
if_above_looting_X:         (drops) if the mob was killed with a looting level greater than X
if_killed_by_X:             (drops) if the mob was killed by X (X is a string entity id)
if_killer_wither_skeleton:  (drops) if the killer is a wither skeleton
if_killer_on_ground:        (drops) if the killer is on the ground
if_killer_burning:          (drops) if the killer is on fire
if_killer_wet:              (drops) if the killer is in water (including rain/snow)
if_killer_submerged:        (drops) if the killer is under water and does not have aqua affinity
if_killer_has_potion_X:     (drops) if the killer has potion X on it (X is a potion id)
if_check_killer_nbt_X:      (drops) if the nbt comparison is true for the killer (see below)

if_damage_type_X:           (drops) if the mob was killed by damage type X
                                Vanilla damage types: inFire, onFire, lava, inWall, drown, starve, cactus, fall,
                                generic, magic, wither, anvil, fallingBlock, mob, player, arrow, fireball, thrown,
                                indirectMagic, thorns, explosion.player, explosion, outOfWorld
if_killed_with_fire:        (drops) if the mob was killed by fire damage
if_killed_with_magic:       (drops) if the mob was killed by magic damage
if_killed_with_projectile:  (drops) if the mob was killed by projectile damage
if_killed_with_indirect:    (drops) if the mob was killed by "indirect" damage
if_killed_with_explosion:   (drops) if the mob was killed by explosion damage
if_killed_with_unblockable: (drops) if the mob was killed by armor-ignoring damage

if_check_nbt_X and if_check_harvester_nbt_X:

For checking nbt tag values, X is the path of the tag, followed by ==, >, <, >=, or <=, and then by the value to compare to. String tags can only be compared using ==. For example, you want to check if the integer value called "Value", which is contained inside the "ForgeData" compound, is greater than or equal to 1 - you would use "if_check_nbt_ForgeData/Value>=1". Values and compounds in lists are represented by their index in that list (the first index is 0, then 1, and so on). For an example using a list, we can check if the mob is below the y-level 16 by using "if_check_nbt_Pos/1<16" (in the "Pos" list, index 0 is the x position, index 1 is the y, and index 2 is the z).

if_in_biome_type_X:

The vanilla biome types are beach, desert, end, forest, hell, hills, jungle, mesa, mushroom, ocean, plains, river, savanna, snow, stone_beach, swamp, and taiga. Hills refers specifically to extreme hills, and hell is the Nether's biome. The type can also be the normal name of any biome in a type - this allows you to still use mod-added biomes and consider them as "types".

if_biome_height_below_X:

Sea level is at 64 blocks in default world generation. In addition to using normal y-values, you can also compare the biome height with the generic heights used by vanilla (e.g., "if_biome_height_below_default").

(y)   name

(6)   deep_oceans
(32)  oceans
(48)  shallow_waters
(57)  partly_submerged

(64)  shores
(67)  rocky_waters
(67)  default
(68)  low_plains
(70)  mid_plains
(70)  low_islands
(78)  low_hills
(96)  mid_hills
(112) high_plateaus


Stats Functions[]

These functions can be used in any array with the name "stats". Stats functions alter the mobs themselves and are only performed as the mob is spawned.

Quick Reference[]

function:  required_field*  optional_field  etc.
name:      value*
modifier:  attribute*  value*  operator  override
equip:     id*  override  slot  drop_chance  damage  count  item_stats
potion:    id*  amplifier  duration  ambient  override
riding:    id*  tags  stats
ridden_by: id*  tags  stats
nbt:       tags*
drops:     functions*  count
command:   value*  count  suppress_output

Full Table[]

Function Description Fields (* - Required)
name Applies a custom name to the mob. value*: the name to apply to the mob. Accepts mob name codes for randomization.
modifier Applies an attribute modifier to the mob. (See here for more info.) attribute*: the string id of the attribute to modify.

value*: (number range) the amount to modify by.

operator: (0/1/2) the operation to apply the value with. Default is 0.

override: (true/false) if true, this instead sets the base attribute to value and ignores operator. Default is false.

equip Equips an item on the mob, optionally setting its drop chance. id*: the id of the item to equip.

override: (true/false) if false, this function will not do anything if the mob already has an item equipped in the slot. Default is false.

slot: slot to equip the item in (0 is hand, 1 is feet, 2 is legs, 3 is body, and 4 is head). Default is 0.

drop_chance: (number range) chance for the equipped item to drop. Default is 0.085.

damage: (number range) the damage value of the item. Default is 0.

count: (number range) the number of the item to equip. Default is 1.

item_stats: array of item stats functions to apply to the item (see Item Stats Functions). Default is none.

potion Applies a potion effect to the mob. id*: the string id of the potion to apply (localization, see here for vanilla ids).

amplifier: (number range) the level of the potion to apply. Default is 0 (level I).

duration: (number range) the duration of the potion to apply, in ticks (20 ticks = 1 second). Default is 2147483647.

ambient: (true/false) true if the potion effect should be less noticable. Default is false.

override: (true/false) if true, the potion will be applied through NBT editing, ignoring normal potion resistances. Default is false.

riding Spawns an entity for the mob to ride. id*: the string id of the new entity.

tags: array of NBT functions to write to the new entity. Default is none.

stats: array of stats functions to apply to the new entity. Only applies to living entities. Default is none.

ridden_by Spawns an entity riding the mob. id*: the string id of the new entity.

tags: array of NBT functions to write to the new entity. Default is none.

stats: array of stats functions to apply to the new entity. Only applies to living entities. Default is none.

nbt Writes NBT data to the entity. tags*: array of NBT functions to write to the entity (see NBT Functions).
drops Used to perform drops functions within the mob's stats. Functions here will be saved and executed when the mob dies after normal drops. functions*: array of drops functions to apply to the entity (see Drops Functions).

count: (number range) number of times to perform the functions. Default is 1.

command Runs a command from the mob. Be careful, as there are no permission limits to commands run this way. value*: the command to run.

count: (number range) the number of times to run the command.

suppress_output: (true/false) if true, command console output will be disabled while the command is run. Default is true.

Mob Name Codes[]

Include these anywhere in the value field of the name function to be replaced by randomized text.

  • ~c - Complete. Generates an entire name. If capitalized, it will base the name on one of the entity's modifiers (eventually - this is a WIP).
  • ~t - Title. Generates a salutation, such as "Mr.", "Madam", or "Doctor".
  • ~p - Prename. Generates a first name.
  • ~s - Surname. Generates a last name. If capitalized, it will base the name on one of the entity's modifiers (eventually - this is a WIP).
  • ~d - Descriptor. Generates a describing word. Generally, you will want to precede this code with "NAME the ". If capitalized, it will base the name on one of the entity's modifiers (eventually - this is a WIP).
  • ~m - Mash. Generates a random name from the mash word generator. (Just jumbles up syllables.)
  • ~n - Normal. Generates a normal name from the list of pre-defined names.

Drops Functions[]

These functions can be used in any array with the name "drops". Drops functions generally alter the items/things that mobs drop and are only performed when the mob is killed.

Quick Reference[]

function:  required_field*  optional_field  etc.
default:   value*
add:       id*  damage  count  item_stats
remove:    id*  damage  count
spawn:     id*  count  tags  stats
set_block: id*  data  update  x  y  z  override  tags
schematic: file*  update  x  y  z  override  air_override
xp:        value*  operation
command:   value*  count  suppress_output

Full Table[]

Function Description Fields (* - Required)
default Determines how the mob's original (default) drops are handled. This starts out as true, and can be toggled off, on, or to equipment-only. Whatever mode this is last set to will be the mode applied to the original drops. value*: (true/false/equipment) if false, removes everything the mob would drop. If equipment, only removes items that are not damageable. Does not affect items added by the add function.
add Adds the item to the mob's drops. id*: the id of the item to add.

damage: (number range) the damage of the item to add. Default is 0.

count: (number range) the number of the item to add. Default is 1.

item_stats: array of item stats functions to apply to the item (see Item Stats Functions). Default is none.

remove Removes the item from the mob's drops. id*: the id of the item to remove.

damage: (number range) the damage of the item to remove. Negative will remove any damage value. Default is -1.

count: (number range) the number of the item to remove. Default is infinite.

spawn Spawns one or more entities as "drops". id*: the string id of the new entity.

count: (number range) the number of entities to spawn. Default is 1.

tags: array of NBT functions to write to the new entity. Default is none.

stats: array of stats functions to apply to the new entity. Only applies to living entities. Default is none.

set_block Sets a block in the world as a "drop". id*: the id of the block to place.

data: (number range) the metadata for the block. Default is 0.

update: what kind of update the block should send. 1 will cause a block update, 2 will send the change to clients (you almost always want this), and 3 will do both. Default is 3.

xyz: the x, y, and z offsets to place the block at, relative to the mob's feet. Defaults are 0, 0, and 0.

override: (true/false/replaceable) if false, this will not replace a pre-existing block. If replaceable, it will replace blocks with a replaceable material, such as snow cover. Default is "replaceable".

tags: array of NBT functions to write to the block's tile entity, if applicable. Default is none.

schematic Places the contents of a schematic file in the world. All your schematics must be located in .minecraft/config/MobPropertiesSchematics/. file*: the file name of the schematic to place. Do not include the file extension (.schematic).

update: what kind of update the placed blocks should send. 1 will cause a block update, 2 will send the change to clients (you almost always want this), and 3 will do both. Default is 3.

xyz: the x, y, and z offsets to place the schematic's origin at, relative to the block's position. Defaults are NaN, 0, and NaN (roughly centers the schematic in the x and z).

override: (true/false/replaceable) if false, this will not replace pre-existing blocks. If replaceable, it will replace blocks with a replaceable material, such as snow cover. Default is "true".

air_override: (true/false/replaceable) if false, air blocks in the schematic will not remove pre-existing blocks. If replaceable, they will remove blocks with a replaceable material, such as snow cover. Default is "false".

xp Alters the mob's xp yield. Only works for mobs without hard-coded xp (most vanilla passives are hard-coded).

value*: (number range) the amount to alter the xp by or to.

operation: (set/add/mult) whether to set, add, or multiply the value to the mob's base xp. Default is "set".

command Runs a command from the mob. Be careful, as there are no permission limits to commands run this way. value*: the command to run.

count: (number range) the number of times to run the command.

suppress_output: (true/false) if true, command console output will be disabled while the command is run. Default is true.

Item Stats Functions[]

These functions can be used in any array with the name "item_stats". Item stats functions are very similar to mob stats functions, but differ slightly in the functions offered and their effects.

Quick Reference[]

function: required_field*  optional_field  etc.
name:     value*
modifier: attribute*  value*  operator
potion:   id*  amplifier  duration  ambient
nbt:      tags*
enchant:  id  level
lore:     value*
color:    value

Full Table[]

Function Description Fields (* - Required)
name Applies a custom name to the item. value*: the name to apply to the item. Accepts item name codes for randomization.
modifier Applies an attribute modifier to the item, which only applies when equipped or held. Applying a modifier will overwrite innate modifiers, such as weapon damage. (See here for more info.) attribute*: the string id of the attribute to modify.

value*: (number range) the amount to modify by.

operator: (0/1/2) the operation to apply the value with. Default is 0.

potion Applies a custom potion effect to the item. In vanilla, this only affects potion items. id*: the string id of the potion to apply (localization, see here for vanilla ids).

amplifier: (number range) the level of the potion to apply. Default is 0 (level I).

duration: (number range) the duration of the potion to apply, in ticks (20 ticks = 1 second). Default is 2147483647.

ambient: (true/false) true if the potion effect should be less noticable. Default is false.

nbt Writes NBT data to the item's tag compound. tags*: array of NBT functions to write to the item's tag compound (see NBT Functions). Default is none.
enchant Applies a specific enchantment to the item or randomly enchants it (like an enchantment table) if none is specified. id: the string id of the enchantment to apply (localization, see here for vanilla ids). If -1, enchants the same as an enchanting table with the given level. Default is -1.

level: (number range) the level of the enchant to apply. Default is 1.

lore Adds a line of lore (info text) to the item. Defaults to purple italic text, but formatting codes are allowed. value*: the line of text to add.
color Dyes the item. Defaults to a random color. In vanilla, only leather armor gets any effect from this. value: (number range) the color to dye the item. Default is "0x000000~0xffffff".

Item Name Codes[]

Include these anywhere in the value field of the name function to be replaced by randomized text.

  • ~c - Complete. Generates an entire name. If capitalized, it will base the name on one of the item's enchantments or modifiers (eventually - this is a WIP).
  • ~i - Info. Generates a name describing what the item is. Randomizes the name of the material and tool if they are not added by a mod.
  • ~p - Prefix. Generates an item prefix. If capitalized, it will base the name on one of the item's enchantments or modifiers (at least, it will - this is a WIP).
  • ~s - Postfix. Generates an item postfix. If capitalized, it will base the name on one of the item's enchantments or modifiers (at least, it will - this is a WIP).
  • ~d - Descriptor. Generates a describing word. Generally, you will want to precede this code with "NAME the ". If capitalized, it will base the name on one of the entity's modifiers (eventually - this is a WIP).
  • ~m - Mash. Generates a random name from the mash word generator. (Just jumbles up syllables.)
  • ~n - Normal. Generates a normal name from the list of pre-defined names.

NBT Functions[]

These functions can be used in any array with the name "tags". NBT functions represent NBT tags saved as an entity or item stack's tag compound. Using these, you can do just about anything. Make sure you know what you are doing when using these. Using the wrong data type or trying to put multiple data types in a tag list will crash your game and may even corrupt your world. For info on vanilla entities, see here. For items, see here.

Use /mpinfo to give yourself a stick that can convert nbt data of in-game entities and tile entities to an nbt function!

Quick Reference[]

function:   required_field*  optional_field  etc.
compound:   name  tags
list:       name  tags
<type>:     name  value
delete:     name
chest_loot: name  loot  inventory_size  count
item_id:    name  value*
potion_id:  name  value*
enchant_id: name  value*
types:
string  boolean  byte  byte_array  short
int  int_array  long  float  double

Full Table[]

Function Description Fields (* - Required)
compound Represents a tag compound, which can contain any number of named tags.

name: the string name of the NBT tag. Leave this out only in tag lists. Default is "".

tags: array of tags (NBT functions) contained in this compound. Default is none.

list Represents a tag list, which can contain any number of unnamed tags. This will preserve the order you apply the tags in. name: the string name of the NBT tag. Leave this out only in tag lists (though I really doubt you will need to make a list of lists). Default is "".

tags: array of tags (NBT functions) contained in this list. NBT functions in here do not use the name field. Default is none.

<type> Represents an NBT value with type of <type>. See the quick reference above for a full list of types. name: the string name of the NBT tag. Leave this out only in tag lists. Default is "".

value: (number range where applicable) the value of the tag. The type you enter here must agree with the tag's type. Default is "", [], 0, or false, depending on type.

delete Completely deletes an NBT tag and all data contained in it. name: the string name of the NBT tag to delete. Leave this out only in tag lists (deletes the last tag in the list). Default is "".
chest_loot Convenience function to generate a tag list containing random items in an inventory format.

name: the string name of the NBT tag. You will not have to specify this for any vanilla tile entity. Default is "Items".

loot: the ChestGenHooks code for the loot list to generate from. Default is "dungeonChest".

inventory_size: so you may fill different size containers or partly fill them. Default is 27 (the chest's inventory size).

count: (number range) overrides the chest loot's usual number of items to generate. Default is the loot list's count range.

item_id Saves an item's numerical id as a short using its string id. You MUST use this to use mod item ids in nbt with any amount of reliability. name: the string name of the NBT tag. You will not have to specify this for any vanilla item. Default is "id".

value*: the string id of the item.

potion_id Convenience method to save a potion's numerical id as a byte using its string id (localization, see here for vanilla ids). name: the string name of the NBT tag. You will not have to specify this for any vanilla potion effect. Default is "Id".

value*: the string id of the potion (localization, usually potion.potionName).

enchant_id Convenience method to save an enchantment's numerical id as a short using its string id (localization, see here for vanilla ids). name: the string name of the NBT tag. You will not have to specify this for any vanilla enchantment list. Default is "id".

value*: the string id of the enchantment (localization, usually enchantment.enchantmentName).

Examples[]

There's no way I could expect you to memorize all of the functions. If I were you, I would go to the quick reference section of each function section and copy/paste them all into a text document so you don't need to come back here and look through them. (Make sure you update it as new versions are released - the changelog will definitely tell you if any functions are added or implemented in an update!)

The easiest way to get your own mob properties started is by making a few files you like and copy/pasting them, altering them and adding on to them as you go.

Anyway, let's get to the examples. I will assume you are using the recommended JSON editor. To read and understand these examples better, copy and paste them into the left side of the editor and hit the right arrow to load it into the right side of the page, then mess around with them as you like. It may be beneficial to you to keep your properties files open while testing them, so you can edit the files and use /mpreload from in game to test your changes immediately.

Easy(ish)[]

Let's start off semi-slow. Here is a file for your spider to make them occasionally spawn weakened cave spiders (basically, babies) when they die.

Functions used: all, spawn, modifier.

{
  "_comment": "this file gives spiders a 5% chance to spawn 2 to 5 weakened cave spiders that do not drop string",
  "_name": "Spider",
  "drops": [
    {
      "function": "all",
      "_comment": "this count effectively means only perform the function 5% of the time",
      "count": 0.05,
      "functions": [
        {
          "function": "spawn",
          "id": "CaveSpider",
          "count": "2~5",
          "stats": [
            {
              "_comment": "set the cave spider's attack strength to 1",
              "function": "modifier",
              "attribute": "generic.attackDamage",
              "value": 1,
              "override": true
            },
            {
              "_comment": "halve the cave spider's max health",
              "function": "modifier",
              "attribute": "generic.maxHealth",
              "value": -0.5,
              "operator": 1
            }
          ]
        }
      ]
    }
  ],
  "stats": []
}

Advanced[]

With this example, we are going to kick it up a notch. We are going to make normal skeletons rarely drop skeleton skulls. In addition, we will also make any skeleton spawned outside of the overworld (Nether, End, or any mod dimension) have double health and get an additional attack damage, health, or speed boost, but also a 5% chance to drop a gold ingot and 1% chance to drop an emerald.

Functions used: if_X, add, modifier, choose, drops.

{
  "_comment": "this file makes normal skeletons drop normal skulls, plus makes skeletons spawned outside the overworld much tougher",
  "_name": "Skeleton",
  "drops": [
    {
      "_comment": "we don't want normal skulls to drop from wither skeletons",
      "function": "!if_wither_skeleton",
      "functions": [
        {
          "_comment": "add skull drop",
          "function": "add",
          "id": "skull",
          "count": 0.02
        }
      ]
    }
  ],
  "stats": [
    {
      "_comment": "if this mob is not spawning in the overworld",
      "function": "!if_in_dimension_0",
      "functions": [
        {
          "_comment": "double the mob's max health",
          "function": "modifier",
          "attribute": "generic.maxHealth",
          "value": 1,
          "operator": 1
        },
        {
          "_comment": "randomly boost either attack strength, max health, or speed, with speed being the rarest",
          "function": "choose",
          "functions": [
            {
              "weight": 2,
              "function": "modifier",
              "attribute": "generic.attackDamage",
              "value": "2.0~4.0"
            },
            {
              "weight": 2,
              "function": "modifier",
              "attribute": "generic.maxHealth",
              "value": "1.0~2.0",
              "operator": 1
            },
            {
              "weight": 1,
              "function": "modifier",
              "attribute": "generic.movementSpeed",
              "value": "0.4~0.6",
              "operator": 1
            }
          ]
        },
        {
          "_comment": "give them a small chance to drop a gold ingot or an emerald for your trouble",
          "function": "drops",
          "functions": [
            {
              "function": "add",
              "id": "gold_ingot",
             "count": 0.05
            },
            {
              "function": "add",
              "id": "emerald",
              "count": 0.01
            }
          ]
        }
      ]
    }
  ]
}

Expert[]

Okay, so now is where we dive into the beautiful world of NBT editing in Mob Properties. This one will make creepers have a 1% chance to spawn charged with 10 times the normal xp, plus they will drop a chest full of random loot similar to a dungeon chest. In addition, creepers also get a 3% chance to become a "psycho" creeper - that is, to spawn with an invisible ocelot riding it (causing the creeper to run around like crazy), a speed boost, and a large explosion radius. Don't be afraid of the massive size of this file - most of the file is just listing the chest's custom loot table. The nbt function "chest_loot" can take care of most of it, as long as we don't mind it using pre-existing chest loot tables, but doesn't give as good of an example.

Functions used: all, nbt, boolean, drops, xp, spawn, byte, short, int, compound, string, list, choose, name, modifier, ridden_by, potion.

{
  "_name": "Creeper",
  "drops": [],
  "stats": [
    {
      "_comment": "1% chance of being charged with bonus xp and chest drop",
      "function": "all",
      "count": 0.01,
      "functions": [
        {
          "function": "nbt",
          "tags": [
            {
              "function": "boolean",
              "name": "powered",
              "value": true
            }
          ]
        },
        {
          "function": "drops",
          "functions": [
            {
              "function": "xp",
              "operation": "mult",
              "value": 10
            },
            {
              "_comment": "falling chest",
              "function": "spawn",
              "id": "FallingSand",
              "tags": [
                {
                  "function": "int",
                  "name": "TileID",
                  "value": 54
                },
                {
                  "function": "byte",
                  "name": "Data",
                  "value": "2~5"
                },
                {
                  "function": "boolean",
                  "name": "DropItem",
                  "value": false
                },
                {
                  "function": "byte",
                  "name": "Time",
                  "value": 1
                },
                {
                  "function": "compound",
                  "name": "TileEntityData",
                  "tags": [
                    {
                      "function": "string",
                      "name": "CustomName",
                      "value": "Toast's Secret Stash"
                    },
                    {
                      "_comment": "Instead of list, you could use chest_loot here to the same effect."
                      "_comment": "Note that we MUST use numerical ids in nbt, so this method may not work well with mod items."
                      "function": "list",
                      "name": "Items",
                      "tags": [
                        {
                          "function": "choose",
                          "count": 8,
                          "functions": [
                            {
                              "_comment": "saddle",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 329
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            },
                            {
                              "_comment": "iron",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 265
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": "1~4"
                                }
                              ]
                            },
                            {
                              "_comment": "bread",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 297
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            },
                            {
                              "_comment": "wheat",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 296
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": "1~4"
                                }
                              ]
                            },
                            {
                              "_comment": "gunpowder",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 289
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": "1~4"
                                }
                              ]
                            },
                            {
                              "_comment": "string",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 287
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": "1~4"
                                }
                              ]
                            },
                            {
                              "_comment": "bucket",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 325
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            },
                            {
                              "_comment": "gold apple",
                              "weight": 1,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 322
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            },
                            {
                              "_comment": "redstone",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 331
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": "1~4"
                                }
                              ]
                            },
                            {
                              "_comment": "record 13",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 2256
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            },
                            {
                              "_comment": "record cat",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 2257
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            },
                            {
                              "_comment": "name tag",
                              "weight": 10,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 421
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            },
                            {
                              "_comment": "diamond",
                              "weight": 5,
                              "function": "compound",
                              "tags": [
                                {
                                  "function": "byte",
                                  "name": "Slot",
                                  "value": "0~26"
                                },
                                {
                                  "function": "short",
                                  "name": "id",
                                  "value": 264
                                },
                                {
                                  "function": "byte",
                                  "name": "Count",
                                  "value": 1
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "_comment": "psycho creeper",
      "function": "all",
      "count": 0.03,
      "functions": [
        {
          "function": "name",
          "value": "Psycho Creeper"
        },
        {
          "function": "modifier",
          "attribute": "generic.movementSpeed",
          "value": 0.3,
          "operator": 1
        },
        {
          "function": "nbt",
          "tags": [
            {
              "function": "byte",
              "name": "ExplosionRadius",
              "value": 6
            }
          ]
        },
        {
          "function": "ridden_by",
          "id": "Ozelot",
          "stats": [
            {
              "_comment": "invisibility",
              "function": "potion",
              "id": 14,
              "ambient": true
            },
            {
              "function": "modifier",
              "attribute": "generic.maxHealth",
              "override": true,
              "value": 1
            }
          ]
        }
      ]
    }
  ]
}

Appendix[]

Below are useful resources and information from other places compiled into one handy location. Yay!

  • Recommended JSON editor [1]
  • Vanilla item/block ids, item damage values, and block metadata [2]
  • Vanilla attributes [3]
  • Vanilla entity NBT format [4]
  • Vanilla item NBT format [5]
  • Text formatting codes (use "\u00a7" for "§") [6]

Added Commands[]

/mpreload - reloads all properties files
/mpinfo <player> - gives the player (optional) an info wand

Vanilla Potion Ids[]

Speed              potion.moveSpeed
Slowness           potion.moveSlowdown
Haste              potion.digSpeed
Mining Fatigue     potion.digSlowDown
Strength           potion.damageBoost
Weakness           potion.weakness
Instant Health     potion.heal
Instant Damage     potion.harm
Jump Boost         potion.jump
Nausea             potion.confusion
Regeneration       potion.regeneration
Resistance         potion.resistance
Fire Resistance    potion.fireResistance
Water Breathing    potion.waterBreathing
Invisibility       potion.invisibility
Blindness          potion.blindness
Night Vision       potion.nightVision
Hunger             potion.hunger
Poison             potion.poison
Wither             potion.wither
Health Boost       potion.healthBoost
Absorption         potion.absorption
Saturation         potion.saturation

Vanilla Enchantment Ids[]

Sharpness              enchantment.damage.all
Smite                  enchantment.damage.undead
Bane of Arthropods     enchantment.damage.arthropods
Knockback              enchantment.knockback
Fire Aspect            enchantment.fire
Protection             enchantment.protect.all
Fire Protection        enchantment.protect.fire
Feather Falling        enchantment.protect.fall
Blast Protection       enchantment.protect.explosion
Projectile Protection  enchantment.protect.projectile
Respiration            enchantment.oxygen
Aqua Affinity          enchantment.waterWorker
Efficiency             enchantment.digging
Silk Touch             enchantment.untouching
Unbreaking             enchantment.durability
Looting                enchantment.lootBonus
Fortune                enchantment.lootBonusDigger
Luck of the Sea        enchantment.lootBonusFishing
Lure                   enchantment.fishingSpeed
Power                  enchantment.arrowDamage
Flame                  enchantment.arrowFire
Punch                  enchantment.arrowKnockback
Infinity               enchantment.arrowInfinite
Thorns                 enchantment.thorns
Advertisement