#Bows, Crossbows, Shields

46 messages · Page 1 of 1 (latest)

gusty scaffold
#

you should go into showing item in hands part and set it into a sheild bow or crossbow and set the size

solid spindle
#

Show us what you did

frigid canyon
#

!faq output-log

frigid geodeBOT
# frigid canyon !faq output-log

The output log will show you errors related to resource packs in Minecraft: Java Edition. Here is how you can enable it: https://i.imgur.com/WbQZa6k.png
(PS: Optifine likes to hide vanilla errors/warnings for some weird reason, so always load the game up without it if you don't need it for your pack to work!)

frigid canyon
#

that might also help

ruby ermine
#

All the models I made have broken. They are either invisible or become broken during the animation. I can't seem to figure out whether or not it's my models themselves but I think they are just not linking up correctly.

frigid canyon
#

k, so you don't need line 60 and 61 in rpg_bows_1 for example @ruby ermine
(just delete both of those lines and put 1 comma there instead)

#

also, idk if that even works like that for bows added with Optifine

#

yeah, so in general it just seems like you completely ignored json structure when adding your overrides sections into the .json files

#

hence why they all error or are invisible

ruby ermine
#

It's my first time 😦

frigid canyon
#

you can edit predicates in Blockbench directly
(Tools > Edit Override Predicates)
Though the tool specific options only appear if your project is called bow (or shield etc.), not if they have custom names

#

Also also, Optifine has its own way for stuff like that
so either use custom_model_data OR use Optifine CIT, not both

#

(cause in vanilla ONLY the base model (bow.json for example) can use overrides/predicates. It won't work in any other model files (it can still cause errors, but it won't "function" as you'd expect in them))

ruby ermine
#

So, Optifine is modded minecraft. Since I believe Vanilla doesn't use Optifine anymore should I use Custom models instead?

frigid canyon
#

Vanilla never used Optifine

But yeah, if you use custom_model_data predicates (which is vanilla) you only put them in the base file (bow.json etc.), not in rpg_bow.json etc.

ruby ermine
#

!faq custom_model_data

frigid geodeBOT
# ruby ermine !faq custom_model_data

Disclaimer: This only works for items (not placed blocks!) and only if you are in Java Edition 1.14 or later!

Example to give a stick 4 new models:
You'd place this file in YourResourcePack/assets/minecraft/models/item and call it stick.json.

stick.json

{
    "parent": "item/generated",
    "textures": {
        "layer0": "item/stick"
    },
    "overrides": [
        { "predicate": {"custom_model_data": 1}, "model": "item/custom_stick"},
        { "predicate": {"custom_model_data": 2}, "model": "custom/branch"},
        { "predicate": {"custom_model_data": 3}, "model": "block/stone"},
        { "predicate": {"custom_model_data": 4}, "model": "item/more_sticks"}
    ]
}```
Ingame you can give yourself one of the custom sticks by doing `/give <player> stick{CustomModelData:X}` (X being replaced by the number you want)

*PS: The model path is **always** relative to the models folder of your pack.*
*So `"item/custom_stick"` will load the model in `YourPack/assets/minecraft/models/item` called custom_stick.json.*
*For `"custom/branch"` it would be the model in `YourPack/assets/minecraft/models/custom` called branch.json and so on.*
ruby ermine
#

Am I just making things overly complicated?

#

I feel like... stuck lol

#

{
"parent": "item/generated",
"textures": {
"layer0": "item/bow"
},
"overrides": [
{ "predicate": {"custom_model_data": 1}, "model": "item/custom_bow"},
{ "predicate": {"custom_model_data": 2}, "model": "custom/bow1"},
{ "predicate": {"custom_model_data": 3}, "model": "block/bow2"},
{ "predicate": {"custom_model_data": 4}, "model": "item/bow3"}
]
}

So this would make 4 different bows correct? Is this method generating a new item or is the item becoming it when you name said item.? If I was to use this custom for a bow would it look something like this?

How would I input the different bow models for each pulling animation?

#

I am sorry for all the questions

frigid canyon
#

and you'd need to make several predicates for each bow (one for the base bow, then 3 (or however many you want) predicates for the pulling stages)

#

!faq bow-model

frigid geodeBOT
# frigid canyon !faq bow-model

This is an example of an overrides section of the bow.json to add more bows for the vanilla Java Edition.
If you don't know how/where to add this to your bow.json file, copy the one from the default pack (check !faq default-pack if you don't know how to get the files) and replace the overrides section in there with this:

"overrides": [
        { "predicate": {"pulling": 1 }, "model": "item/bow_pulling_0" },
        { "predicate": {"pulling": 1, "pull": 0.65 }, "model": "item/bow_pulling_1" },
        { "predicate": {"pulling": 1, "pull": 0.9 }, "model": "item/bow_pulling_2" },

        { "predicate": { "custom_model_data": 1 }, "model": "custom/fire_bow" },
        { "predicate": { "custom_model_data": 1, "pulling": 1 }, "model": "custom/fire_bow_pulling0" },
        { "predicate": { "custom_model_data": 1, "pulling": 1, "pull": 0.65 }, "model": "custom/fire_bow_pulling1" },
        { "predicate": { "custom_model_data": 1, "pulling": 1, "pull": 0.9 }, "model": "custom/fire_bow_pulling2" }
]```
**Explanation of the predicates:**
_pulling_ = bow gets pulled (either 0 or 1)
_pull_ = how much is the bow pulled in % (numbers from 0 to 1)

You can also have more/less pull models if you want it to look smoother btw.
Keep in mind that the order of predicates matters. It will always use the model of the last predicate in the list whose conditions are all met!
frigid canyon
#

in the end the overrides part would look something like that (for 1 default bow and 1 custom bow)

#

assuming you want your custom bows to have the same exact pulling animation timing as the default bow

ruby ermine
#

Is the location of bow 1 correct or does it not matter where you put in the override?

#

I assume that I would just make 1 big file for all my bows or should I make multiple json files for the named items?

ruby ermine
#

I guess a better question is how do I get access to the Java json packs?

#

@frigid canyon

#

oh wait

#

!faq default-pack

frigid geodeBOT
# ruby ermine !faq default-pack

Disclaimer: Use these packs as REFERENCE, don't put your models inside them, it just increases your pack needlessly. Also don't put any of the unedited files from it into your own pack. The distributions of default assets in your pack is illegal.

For Java Edition:
(This works the same for all versions, 1.17 is just used as an example here)
Go to .minecraft/versions/1.17 and open the 1.17.jar in there with a zip program. Alternativley you can copy the .jar file and change the file extension to .zip and double click it.
Extract/copy the "assets" folder inside the jar somewhere. It contains all the default models/textures.

For Bedrock Edition:
Go to https://docs.microsoft.com/en-us/minecraft/creator/documents/resourcepack and scroll to "Building the Resource Pack". The download for the vanilla resource pack can be found right above that title.
Alternatively here is the direct download link: https://aka.ms/resourcepacktemplate

ruby ermine
#

Do you have a guide on how to use Override Predicates?

frigid canyon
#

in BB go to Tools > Edit Override Predicates
In there you can create a list of predicates, each one with their own filters (like pull amount, is pulling, custom_model_data etc.)
You can assign several filters for a predicate by pressting the + icon in the same line as the predicate
That's it, the rest is knowing what each predicate filter is used for (usually self explanatory) and what values they use (anything that needs a number value (except for custom_model_data) requires a value between 1.0 and 0.0)

ruby ermine
#

If I was to work a cross bow I got everything else to work but I am having a hard time getting the firework animation to activate any advice?

frigid canyon
ruby ermine
#

Yes

frigid canyon
#

there is a "firework" predicate

#

!faq crossbow-model

frigid geodeBOT
# frigid canyon !faq crossbow-model

This is an example of an overrides section of the crossbow.json to add more crossbows for the Java Edition.
If you don't know how/where to add this to your crossbow.json file, copy the one from the default pack (check !faq default pack if you don't know how to get the files) and replace the overrides section in there with this:

"overrides": [
  { "predicate": {"pulling": 1 }, "model": "item/crossbow_pulling_0" },
  { "predicate": {"pulling": 1, "pull": 0.58 }, "model": "item/crossbow_pulling_1" },
  { "predicate": {"pulling": 1, "pull": 1.0 }, "model": "item/crossbow_pulling_2" },    
  { "predicate": {"charged": 1 }, "model": "item/crossbow_arrow" },
  { "predicate": {"charged": 1, "firework": 1 }, "model": "item/crossbow_firework" },
  
  { "predicate": {"custom_model_data": 1}, "model": "custom/big_crossbow" },
  { "predicate": {"custom_model_data": 1, "pulling": 1 }, "model": "custom/big_crossbow_pulling_0" },
  { "predicate": {"custom_model_data": 1, "pulling": 1, "pull": 0.58 }, "model": "custom/big_crossbow_pulling_1" },
  { "predicate": {"custom_model_data": 1, "pulling": 1, "pull": 1.0 }, "model": "custom/big_crossbow_pulling_2" },      
  { "predicate": {"custom_model_data": 1, "charged": 1 }, "model": "custom/big_crossbow_arrow" },
  { "predicate": {"custom_model_data": 1, "charged": 1, "firework": 1 }, "model": "custom/big_crossbow_firework" }
]```

**Explanation of the predicates:**
_pulling_ = crossbow gets pulled (either 0 or 1)
_pull_ = how much is the crossbow pulled in % (numbers from 0 to 1)
_charged_ = crossbow was fully charged and has ammo loaded (either 0 or 1)
_firework_ = crossbow has a firework loaded (either 0 or 1)

You can also have more/less pull models if you want it to look smoother btw.
Keep in mind that the order of predicates matters. It will always use the model of the last predicate in the list whose condiitons are all met!
frigid canyon
#

here you can see how it's used (once without and once with custom_model_data)

#

the first five predicate lines are directly copied from the default crossbow btw.