Tutorial: Creating Custom Slimes - Chakyl/splendid-slimes GitHub Wiki

Introduction & Prerequisites

Since Splendid Slimes is purely data-driven, creating custom Slime breeds can be done purely by creating Json files and textures! This is best used for Modpack developers who want to add Slimes based on modded items, or resources not included in the base mod.

Before you ready the rest of this tutorial, you should have a basic understand of these things:

In the following example, we will be making a "Bunny Slime" breed.

Defining the Breed

Before anything else, you must define the breed of the Slime and it's diet in the directory splendid_slimes\slimes. Since we're making a Bunny slime, the file should be named bunny.json. When possible, include the breed of the Slime in the file name for organization!

Inside of bunny.json, add the following:

{
  "breed": "bunny",
  "name": "slime.splendid_slimes.bunny",
  "color": "#644d38",
  "particle": {
    "item": "minecraft:wool"
  },
  "hat": {
    "item": "minecraft:carrot"
  },
  "hat_scale": 1.0,
  "hat_x_offset": 0,
  "hat_y_offset": -1.0,
  "hat_z_offset": -0.05,
  "diet": "diet.splendid_slime.bunny",
  "foods": [
    { "item": "minecraft:carrot" },
    { "item": "minecraft:golden_carrot" }
  ],
  "favorite_food": {
    "item": "minecraft:golden_carrot"
  },
  "entities": [
      "minecraft:spider",
      "minecraft:cave_spider"
  ],
  "favorite_entity": "minecraft:cave_spider",
  "hostile_to_entities": [
    "minecraft:villager"
  ],
  "traits": ["moody"],
  "innate_effects": [
    {
      "effect": "minecraft:jump_boost",
      "amplifier": 2
    }
  ],
  "positive_emit_effects": [
    {
      "effect": "minecraft:luck",
      "duration": 300,
      "amplifier": 0
    }
  ],
  "emit_effect_particle": "minecraft:angry_villager",
  "negative_emit_effects": [
    {
      "effect": "minecraft:unluck",
      "duration": 120,
      "amplifier": 0
    }
  ],
  "positive_commands": [
    "say click clack rabbit that goes jump"
  ]
  "negative_commands": [
    "tp @e[distance=..16] @e[limit=1,sort=nearest]"
  ],
  "attack_commands": [
    "summon zombie ~ ~ ~ {DeathLootTable:\"minecraft:empty\",Health:8f,ArmorItems:[{},{},{},{id:\"minecraft:slime_block\",Count:1b}],ArmorDropChances:[0.085F,0.085F,0.085F,0.000F],Attributes:[{Name:generic.max_health,Base:8}]}"
  ]
}
  • breed - ID of the slime breed. Should follow the same conventions as Minecraft IDs.
  • name - Slime name Component. It's best to use a translation key instead of just a string so others can make translations.
  • color - Hex code for the primary Slime color. This is used in a few places such as Slime Hearts to reduce the amount of textures needed to be created.
  • particle - The item used as a particle when the Slime jumps. Defaults to its plort.
  • hat - Item rendered as a "hat" aka on top of the Slime (by default) that is passed to the Largo.
  • *hat_scale - Scale applied to the hat when it is being rendered. This and the below hat options allow adjusting of positioning. (Default: 1)
  • *hat_x_offset - X offset applied to the hat. (Default: 0)
  • *hat_y_offset - Y offset applied to the hat. (Default: -1.0)
  • *hat_z_offset - Z offset applied to the hat. (Default: -0.05)
  • diet - Component of the foods Slimes eat for players using JEI and Jade (See image). Be as vague or mysterious as you'd like. Like the name field, use a translation key!
    • image
  • *foods - Array of item or tags that set which foods the Slime will eat or target.
  • *favorite_food - The food item that will make the Slime produce double Plorts when eaten. This food should be included in foods!
  • *entities - Array of entities that Slime will target, attack, and eat.
  • *favorite_entity - The entity that will make the Slime produce double Plorts when eaten. This entity should be included in entities!
  • *hostile_to_entities - Array of entities that Slime will target, attack, but not eat. When a Slime is targeting one of these entities, it will store that entity's UUID in its nbt as TargetEntity. When not targeting, it will be set to "".
  • *traits - Array of Traits in lowecase. A list of currently implemented traits can be found here.
  • *innate_effects - Array of effects that will be infinitely given to the Slime. Does not accept a duration.
  • *emit_effect_particle - Particle used when a Slime performs negative/positive effects
  • *positive_emit_effects - Array of effects that will be emitted in a radius around the Slime when its happiness is high
  • *negative_emit_effects - Array of effects that will be emitted in a radius around the Slime when its happiness is low
  • *positiveCommands List of commands that will be executed as the Slime when its happiness is high
  • *negativeCommands List of commands that will be executed as the Slime when its happiness is low
  • *attackCommands List of commands that will be executed every 30 seconds when it is targeting a hostile_to_entities entity.

*This property is optional, though you should at least have one food/entity included so the Slime can eat.

Recipes

Plort Ripping

Plort Rippits have recipe types defined that can be used to turn Plorts into resources. These can be placed in the recipes directory of your datapack (e.x: bunny_plort_ripping.json, and has the following schema:

{
  "type": "splendid_slimes:plort_ripping",
  "ingredient": {
    "item": "splendid_slimes:plort",
    "nbt": {
      "plort": {
        "id": "splendid_slimes:bunny"
      }
    }
  },
  "results": [
    {
      "item": "minecraft:rabbit_hide",
      "count": 2,
      "weight": 3
    },
    {
      "item": "minecraft:rabbit_foot",
      "count": 1,
      "weight": 1
    }
  ]
}
  • type - Must be set to splendid_slimes:plort_ripping.
  • ingredient - The item to be ripped. This can be anything, but should be set to a Plort. The nbt property specifies the plort data, and the id should match the breed.
  • results - An array of weighted items that are possible to rip from a Plort. The Plort Rippit will always output one of the entries, but the chance depends on the weights. In this example, the total of all weights is 4, so Rabbit Hide has a 3 in 4 chance to be produced from a Bunny Plort, while a Rabbit Foot has a 1 in 4 chance. You can have as many items as you want in this array, but up to 9 will show properly in JEI.

Plort Pressing

Each Slime should have a recipe for turning Plorts into Slime Hearts. The Plort Press has the following schema:

{
  "type": "splendid_slimes:plort_pressing",
  "ingredient": {
    "count": 64,
    "item": "splendid_slimes:plort",
    "nbt": {
      "plort": {
        "id": "splendid_slimes:bunny"
       }
     }
   },
  "result": {
    "item": "splendid_slimes:slime_heart",
    "nbt": {
      "slime": {
        "id": "splendid_slimes:bunny"
      }
    }
  }
}
  • type - Must be set to splendid_slimes:plort_pressing.
  • ingredient - Item for the input (top slot).
  • result - The resulting heart in the output slot.

Fusion

Additionally, the Plort Press has support for fusing items into Slime Hearts in the bottom slot. This can be done for special breeds of Slimes, allowing for some sort of genetics/progression:

{
  "type": "splendid_slimes:plort_pressing",
  "ingredients": [
    {
      "item": "splendid_slimes:slime_heart",
      "nbt": {
        "slime": {
          "id": "splendid_slimes:gold"
        }
      }
    }
  ],
  "output": {
    "item": "splendid_slimes:slime_heart",
    "nbt": {
      "slime": {
        "id": "splendid_slimes:slimy"
      }
    }
  },
  "result": {
    "item": "splendid_slimes:slime_heart",
    "nbt": {
      "slime": {
        "id": "splendid_slimes:bunny"
      }
    }
  }
}
  • type - Must be set to splendid_slimes:plort_pressing.
  • ingredients - An array of items for the input (top slot). This can be another Slime Heart or any type of item
  • output - The Slime Heart in the output slot that will be combined with the top slot.
  • result - The resulting heart in the output slot.

Assets

The final step is creating art for your custom Slime! Unlike the previous steps that are done using Data Packs, assets are done using Resource Packs.

Plort Assets

in splendid_slimes/textures/item/plort add bunny.png for the Plort texture. If you aren't feeling particularly creative, you can recolor the basic Plort texture here. That said, for accessibility it's best to add a non-color detail so that color vision deficient players can differentiate between Plorts.

Model Json

in splendid_slimes/models/item/plort add bunny.png. layer0 should be the path to your texture.

{
  "parent": "item/generated",
  "textures": {
    "layer0": "splendid_slimes:item/plort/bunny"
  }
}

Slime Assets

in splendid_slimes/textures/entity/slime add bunny.png for the Slime's texture. Like the Plort, if needed you can use one of the pre-packaged assets for this here. For example, if you're making an Iron slime, it would be easiest to recolor the gold slime As a general tip, it's best to texture the Slime first, and then apply a 50-70% opacity to the opaque parts of the texture.

Hats

For Slime hats, you can choose any item or block item, even modded. If you want to make your own custom hat, you can provide the model json in assets/splendid_slimes/moodel/item/hat like the built-in ones. they are for Slimes like some of the ones included in the mod.

Lang

A resource pack with a lang file is necessary for communicating information to the player. New Slimes will require some info for JEI, which should contain some helpful info for your players:

{
  "slime.splendid_slimes.bunny.info": "Hops around and has a good time! Can be found where Rabbits are!"
}

If you're using translation keys for the name and diet (Like in the above example), you'll need to specify those as well:

{
  "diet.splendid_slimes.bunny": "Carrots",
  "slime.splendid_slimes.bunny": "Bunny"
}