BounceStyles - BounceSMP/wiki GitHub Wiki
A quick rundown;
BounceStyles is our mod for making costumes/additional player customisation items using custom GeckoLib Armor models. if some of these words mean nothing to you, don't worry as I'll explain anything necessary as it becomes relevant.
First things first is making our model. We'll be using Blockbench, and the GeckoLib animation plugin for it.
We make a new Geckolib Animated Model, and change it's Geckolib Properites to Armor.
This will give us a template to work with, as well as the necessary parent bones for us to work on.
Some important things to note about creating your models:
- While you can delete the "dontTouch" cubes if you really don't want the reference, the existing bones must remain otherwise the model will not function. i.e. bipedHead, armorHead, bipedBody, armorBody etc.
- A good practice, especially if you wish to animate parts of your model, is to make sure all your cubes are at least within their own bone child under the relevant armor bone. If you only animate the armor bone, the animation will not be applied in game. (See below for an example of how to properly structure your bones)
(This section may be simplified once I work on a Blockbench plugin, but for now I'll guide you through the regular export process)
When we export, we'll need to export two-to-three things (depending on if you made animations).
- The Model
- The Texture
- The Animation (if applicable)
To export our model, we simply export it through Blockbench under File->Export->Export GeckoLib Model
Name your model file whatever you like, just make sure it's all lower case. I recommend ending the file in ".geo.json", and keeping the name the same across each file, as this will make importing simpler, but the import process also has options if you want to change up your naming scheme between files.
Saving the texture is as simple as clicking the save button next to your texture.
Finally, if you made any animations, make sure to export these under Animation->Export Animations... (and choose which animations you wish to export), which follow the same rules/tips as models. These files I recommend ending with ".animation.json".
In order to get our outfit pieces into the game, we need to do two things: Registering the pieces of your model into BounceStyles through the styles json files, and providing your models, textures, and animations through resource pack(s).
NOTE: THIS SEGMENT IS OUTDATED AS OF 2.0. I WILL TRY TO UPDATE THIS WITH NEW INFORMATION ASAP
To register our outfit pieces, we need to modify the relevant json files within the minecraft/styles
folder. For example, if our model contains a Hat and Jacket, we need to register it within Head.json
and Body.json
. This can be applied for each slot, as needed; Head
, Body
, Legs
, and Feet
.
You can use the following list to understand what properties you can specify when adding a new entry to a json;
name
- (Required) Used for registering the item internally, and as a backup in case you don't specify some later properties.
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
animations
- (Optional) Used to tell BounceSMP which Animations, from your .animation.json, to associate with particular player states. (More details further below).
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
transition_ticks
- (Optional) Specify how long animation transitions should take between states. (i.e. from Idle to Walking, etc.)
hidden_parts
- (Optional) A Json 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
.
When it comes to animations, there are a couple of states you can assign animations to, as follows;
idle
- When the player is standing still.
walking
- When the player is walking.
sprinting
- When the player is sprinting.
sneaking
- When the player is sneaking/crouched.
flying
- When the player is Flying with Elytra.
swimming
- When the player is Swimming.
in_air
- When the player is not on the ground. (Jumping, Falling etc. - Flying takes higher priority than this.)
You don't need to define all of these states, only the ones that you wish to apply animations to.
I'll provide an entry template that shows all options available for an item, however only name
is required. The rest will be automatically assumed using name
if they aren't present. For example, if we register a Head item with the name my_model
, BounceStyles will assume the model is found in assets/bounce_styles/geo/my_model.geo.json
, and will register it as bounce_styles:my_model_head
in-game. If you specify a model, texture, or animation id, these will automatically direct to the relevant folder within the given namespace. For the example below, the model_id
would point to assets/my_namespace/geo/my_item_model.geo.json
, etc.
{
"name": "my_model",
"model_id": "my_namespace:my_item_model.geo.json",
"texture_id": "my_namespace:my_item_texture.png",
"animation_id": "my_namespace:my_item.animation.json",
"animations": {
"idle": "idle_anim",
"walking": "walking_anim"
},
"hidden_parts": [
"head",
"body"
]
}
Structuring your resources is important. You can use any namespace you like (for example: Minecraft's namespace is minecraft
, so it's resources fall under assets/minecraft/
). By default, BounceStyles assumes your resources use the bounce_styles
namespace. If you wish to use your own, you will need to specify this when we get to registering our items.
Also make sure you follow these rules with your assets:
- Make sure your models are inside
assets/namespace/geo
- Make sure your textures are inside
assets/namespace/textures
- Make sure your animations are inside
assets/namespace/animations
Additionally, if you wish to give your item it's own Item Model, you can do so under the bounce_styles
namespace. So with the my_item
Hat Item example, we can make an item model under assets/bounce_styles/models/item/my_item_head.json
.