Style Creation: Registration and Pack creation - BounceSMP/BounceStyles GitHub Wiki

Introduction

In order to get our style into the game, we need to make a style pack. Style packs are essentially data packs and resource packs, stored in a central styles folder within the Minecraft instance directory.

Example

Style Pack Structure

A style pack can be either a folder or .zip file within the styles folder. It contains your assets and .json files which will store all the details of each style you wish to register with this pack.

Client assets such as textures, models, animations, and language files are stored in assets.

Server data, specifically the files that define your Styles for registration, is stored in data.

Example

Assets

GeckoLib is rather strict with where files are located, so it's important to structure your assets as follows:

  • Models must go inside assets/<namespace>/geo
  • Textures must go inside assets/<namespace>/textures
  • Animations must go inside assets/<namespace>/animations

Replace <namespace> with whatever you like, but try to use something unique so that other style packs don't override your stuff by accident. For reference, Minecraft uses the minecraft namespace.

Warning

All namespaces, files, and folders must be lowercase and can only contain numbers, letters, underscores, and hyphens. These rules are specified by Minecraft itself, and not following them will result in your style pack failing to load.

Data

Registering your styles is all done the same as things like mob variants in a data pack; Each style you want to add to the game should be defined in a .json file within your data folder.

The structure to follow for data is data/bounce_styles/bounce_styles/styles (The two bounce_styles folders here is not a typing mistake, this is due to how modded registries work), where you can then place the .json files for each of your styles.

Style Json Example

Here is a basic example of a style .json file that registers a single style, and shows each of the available properties that can be specified for your styles.

{
  "name": "example_style",
  "model_id": "bounce_styles:example_style.geo.json",
  "texture_id": "bounce_styles:example_style.png",
  "texture_variants": [
    "bounce_styles:example_style_blue.png",
    "bounce_styles:example_style_pink.png"
  ],
  "animation_id": "bounce_styles:example_style.animation.json",
  "animations": {
    "idle": "idle_anim",
    "walking": "walking_anim",
    "sneaking": "sneaking_anim"
  },
  "transition_ticks": 0,
  "hidden_parts": [
    "armor.*",
    "curio.*",
    "head",
    "body",
    "left_arm",
    "right_arm",
    "left_leg",
    "right_leg"
  ],
  "slots": [
    "head",
    "body",
    "legs",
    "feet"
  ],
  "credits": [
    "Me :)"
  ]
}

Important

When referencing a file from your style .json, BounceStyles will default to the bounce_styles namespace if one is not provided as part of a particular property.

Json Breakdown

You can use the following list to understand what properties you can specify when adding a new entry to a style .json:

  • name (Required)

    • This is used as an internal ID for this style. It will be used as default for missing optional fields, and is used to specify a human-readable name in lang files.
  • model_id (Optional)

    • Used to specifically tell BounceStyles which model file to use. Otherwise, it will use name and assume the location as follows: assets/bounce_styles/geo/<name>.geo.json
  • texture_id (Optional)

    • Used to specifically tell BounceStyles which texture file to apply to your model. Otherwise, it will use name and assume the location as follows: assets/bounce_styles/textures/<name>.png
  • animation_id (Optional)

    • Used to specifically tell BounceStyles which animation file to use if you also specify animations. Otherwise, it will use name and assume the location as follows: assets/bounce_styles/animations/<name>.animation.json
  • slots (Required)

    • An array used to specify which slots this style is designed for. BounceStyles will use this to split the model up and display the appropriate bones for each slot.
    • Accepted slots are: head, body, legs, and feet.
  • hidden_parts (Optional)

    • An array used to specify player model parts to hide when this piece is equipped.
    • Available parts include: head, body, left_arm, right_arm, left_leg, and right_leg.
    • You can also hide armor slots, and even accessories added with the Curios or Trinkets mods.
      • For armor, you can use armor.head, armor.body, armor.legs, or armor.feet.
        • Use armor.* to hide all armor slots.
      • For Curios/Trinkets slots, you can use curios.<group> or curios.<group>.<slot>.
        • Use curios.* to hide all Curios/Trinkets slots.
  • transition_ticks (Optional)

    • Specify how long animation transitions should take between states. (i.e. changing from idle to walking, etc.)
  • animations (Optional)

    • Used to tell BounceSMP which animations, from your <name>.animation.json, to associate with particular player states.
    • When it comes to animations, there are a number of states you can assign animations to, as follows (ordered based on highest to lowest priority used by the animation system):
      • sleeping - When the player is asleep in a bed.
      • swimming - When the player is swimming. (i.e. "sprinting" in water)
      • flying - When the player is flying with elytra.
      • in_air - When the player is not on the ground. (i.e. jumping, falling, etc.)
      • sneaking - When the player is sneaking/crouched.
      • sprinting - When the player is sprinting.
      • walking - When the player is walking.
      • idle - When the player is standing still.
    • You don't need to define all of these states, only the ones that you wish to apply animations to.
⚠️ **GitHub.com Fallback** ⚠️