Example Resources: Included.
Due to me not being a model creator, I included a free pack of models which includes four painting models, 2 with animated art.
Created by:
https://polymart.org/user/18768
RELEASE TEST VERSION 0.0.1
This is a test release, many features are being worked on and not yet implemented/completed. This plugin will copy a resource-pack into its plugins/blocks folder to be used to see the painting models. As well as their JSON files for the example to work upon loading the plugin!
Built for: Paper servers 1.21.8
(Not spigot tested normally I do spigot targets but this one targets paper, so let me know)
Current features: JSON Defined implementation, Hot-reload, Rotation, Any-Direction Placement (You can place models on walls,roof,floor).
Currently being worked on:
Collision (Basic concept implemented, removed until stabilized as of 0.0.2)
A lot of other stuff is planned to be worked on and implemented.
(for example a gui of implemented models you can open and get them from)
With minor modification for use, models intended for Oraxen/ItemsAdder can be used with this plugin.
Current plan for pricing: Free! Not $20.
Installation: Drag and Drop plugin into server plugins.
Works in a hybrid of the old-school method.
Inside your resource pack, you will need to use the barrier.json to define models.
________________________________________________________
{ "model": { "type": "minecraft:range_dispatch",
"property": "minecraft:custom_model_data",
"fallback": {
"type": "model",
"model": "minecraft:item/barrier"
},
"index": 0,
"entries": [
{
"threshold": 101.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_childhood"
}
},
{
"threshold": 102.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_duck"
}
},
{
"threshold": 103.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_inside"
}
},
{
"threshold": 104.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_amongus"
}
}
]
}
}
________________________________________________________
Once defined they rely on the plugins JSON files which look like so for now.
______________
{ "id": "painting_1", "name": "Painting 1", "baseMaterial": "BARRIER",
"drops": ["SELF"],
"container": true,
"customModelData": 101
}
______________
Do not worry the, drops portion and container are not yet implemented, just leave them be for now or you will get unintended behavior on your models.
Defining a new model is easy, in the plugin/blocks folder create a new json "106_mymodel.json" <--- I would add the number ID to make life easier.
This portion of the JSON defines the custom ID for the resource pack
"customModelData": 101"
This is what will target the model, which you put in barrier.json
""threshold": 101.0," <--In the example resourcepack that is painting_1.
Commands:
/imodel give UserName model_id
/imodel reload
Permissions for now:
blockdef.admin
Converting model packs intended for Oraxen/ItemsAdder:
Open it, ignore everything but the resourcepack folder, copy it out of the pack.
head into the models/textures folder.
(In most cases the textures folder will contain a folder named after the pack)
assets/modelpackname/ textures/kitchen/ for example
rename this folder to /textures/block for any you plan to use.
Now head back into the assets/modelpackname/models/modelpackname folder. This should contain the json models, you will have to open each and edit the lines...
"textures": { "0": "plastic:gallery/painting", "particle": "plastic:gallery/painting" }
to the block textures target we changed.
"textures": { "0": "plastic:block/painting", "particle": "plastic:block/painting" }
Then it should work as we want now for this plugin.
This is when you would now head into this plugins blocks folder and define a json for it giving it a unique custommodeldata ID such as 105.
{ "id": "fridge_1", "name": "Refrigerator", "baseMaterial": "BARRIER",
"drops": ["SELF"],
"container": true,
"customModelData": 105
}
FOR NOW DO NOT CHANGE THE baseMaterial ever.
The resource pack is threshold based, so make sure to mark your model numbers up in order else you will wreck things. but for each new model you up the customidnumber like in this example barrier.json which is located in your resourcepacks /assets/minecraft/items/barrier.json
{ "model": { "type": "minecraft:range_dispatch","property": "minecraft:custom_model_data",
"fallback": {
"type": "model",
"model": "minecraft:item/barrier"
},
"index": 0,
"entries": [
{
"threshold": 101.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_childhood"
}
},
{
"threshold": 102.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_duck"
}
},
{
"threshold": 103.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_inside"
}
},
{
"threshold": 104.0,
"model": {
"type": "model",
"model": "plastic:gallery/painting_amongus"
}
}
]
}
}
To get the correct models in game make sure the threshold matches your pluginsfolder/blocks/model.json's custommodeldata number. Then to get the correct model target the model in your resourcepack
" "model": "plastic:gallery/painting_childhood""
My hope is the example pack and setup will help with learning as once you get started, its actually really easy to use.
You do no need to reload the server when adding new models
simply use /imodel reload and reload your texture pack and bam.
I promise I will fix all this to make more sense and make video tutorials. For now early testers are welcome to see if they like the concept so far. It is far from being large server ready. Tons of features are planned as I also plan to make this work for adding in custom 2D items later on (swords/etc/openable loot with custom drops when used)
ALMOST FORGOT, to pick up the placed models SNEAK and left or right click the base. SPIGOT messed up my included code and inserted "
" BBcode into them that is not part of the code. I'm tired of fixing it so I removed the code bb.