#How do i get the item code

1 messages · Page 1 of 1 (latest)

last crescent
#

like this - CARVED_PUMPKIN.JSON CODE

{
"parent": "item/generated",
"textures": {
"layer0": "item/carved_pumpkin"
}, but for a sword or somthing

strange summitBOT
#
Welcome to the help forum!

Please make sure to read #1029373817119838218 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

potent pulsar
#

!faq default pack

strange summitBOT
# potent pulsar !faq default pack
FAQ
Minecraft: 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 distribution of default assets in your pack is illegal.

For Java Edition:

Simple Method
Use the Pack Creator utility from the Resource Pack Utilities Blockbench plugin. Make sure to enable the Import vanilla assets option.

Manual Method
(This works the same for all versions, 1.21 is just used as an example here)
Go to .minecraft/versions/1.21 and open the 1.21.jar file with a zip program.
Alternativley you can copy the .jar file and change the file extension to .zip, then double click it.
Extract/copy the "assets" folder from inside the jar. This folder contains all the default models and textures.

For Bedrock Edition:

Go to the bedrock resource pack documentation and scroll to "Building the Resource Pack". The download for the vanilla resource pack can be found right above that title. You can also use this Direct download link.

last crescent
#

I dont get how this helps me

potent pulsar
# last crescent like this - CARVED_PUMPKIN.JSON CODE ========================== { "parent": "it...

did you by chance come from this video
https://www.youtube.com/watch?v=Cw8PPPEl_IQ&t=710s

A huge thank you to Violet for teaching me all of this: https://twitter.com/violxiv

A stream where I make hats: https://www.youtube.com/watch?v=PfHN7cO87sc

Minecraft commands, particularly around NBT values have changed from 1.20.5 so I've updated them below for those who need it :)

00:00 - Intro
00:50 - Creating your model
06:49 - Texturing ...

▶ Play video
last crescent
#

yea

#

and i got to the part about the pumkin

potent pulsar
#

I remember this because the part about the pumpkin is just wrong

last crescent
#

but im trying to make a sword

last crescent
potent pulsar
#

do you want to make a custom sword model or just retexture

last crescent
#

custom sword model

potent pulsar
#

ok do you have anything so far

last crescent
#

yes i already made a sword and followed most of the video

potent pulsar
#

ok is it saved as a json file named one of the default sword names like diamond_sword

last crescent
#

it says model.json

potent pulsar
#

ok cool
do you want this model to:
replace an existing sword completely?
or
only change to use your model when you rename it?

#

and if you want the 2nd option are you using it for a Minecraft version 1.21.5 or newer

last crescent
#

uhh the second one

#

and yes

potent pulsar
#

ok gotcha

#

which sword do you want to change when you rename it

#

like golden, diamond, netherite

#

you can choose more than one

last crescent
#

I dont really know what you mean?

#

like in a anvil?

potent pulsar
#

yes

#

so when you change the name of a sword in an anvil, it uses your model

last crescent
#

then diamond

potent pulsar
#

alrighty gimme a sec

#
  "model": {
    "type": "minecraft:condition",
    "property": "minecraft:has_component",
    "component": "minecraft:custom_name",
    "on_true": {
      "type": "minecraft:select",
      "property": "minecraft:component",
      "component": "minecraft:custom_name",
      "cases": [
        {
          "when": {
            "text": "Example Name"
          },
          "model": {
            "type": "minecraft:model",
            "model": "item/example_model"
          }
        }
      ],
      "fallback": {
        "type": "minecraft:model",
        "model": "item/diamond_sword"
      }
    },
    "on_false": {
      "type": "minecraft:model",
      "model": "item/diamond_sword"
    }
  }
}```
#

This will be the contents of a file "diamond_sword.json" that goes in assets/minecraft/items
not assets/minecraft/models/item, the two are often confused

#

and of course change the "Example Name" to whatever you'd like

#

and change the example_model to what you decide for your custom model

#

the one that is currently just named "model"

#

oh one more thing this only works if you are using Minecraft 1.21.5 or newer

#

if you are using older versions you will need to use the Optifine CIT method

last crescent
#

Okay thanks so much i sadly had to leave so i can’t see if it works right now but i’ll check latter do you need me to close this?

potent pulsar
#

nah leave it open until your issue is fixed

last crescent
#

okay thanks

potent pulsar
#

ok if you have questions when you come back feel free to ping me

last crescent
#

so how do i get the blank image

#

that goes in the misc folder

restive pine
restive pine
potent pulsar
restive pine
# potent pulsar wait fr? I gotta reformat my own pack files then

yeah, the way you have it (and is in the most viewed tutorial about this too unfortunately) it's an unecessary extra check.
It's like

if (custom_name) {
  if (custom_name == 'Test') doStuff();
}```
at which point you can just skip the first check (since there ofc is no worry about having to check for null to prevent errors etc.)
potent pulsar
#

ok good to know 👍
It makes sense but I guess I made the assumption that you had to do the kinda "existing" check before checking the value

restive pine
#

yeah, fortunately not necessary in resource pack files 😅

last crescent
#

im not o sure what i did wrong maybe its the command but its not summoning the item

#

the command i did was /give @s minecraftdiamond_sword{Curved_Blade}

restive pine
#

/give @s diamond_sword[custom_name="Curved_Blade"]

last crescent
#

js like that or do i need to change the custom_name part

#

dose it matter if the resource pack is in compactable

restive pine
last crescent
#

i tryed 3 more times and still nothing is there something wrong with my code

#

{
"model": {
"type": "minecraft:condition",
"property": "minecraft:has_component",
"component": "minecraft:custom_name",
"on_true": {
"type": "minecraft:select",
"property": "minecraft:component",
"component": "minecraft:custom_name",
"cases": [
{
"when": {
"text": "Curved Bladefor"
},
"model": {
"type": "minecraft:model",
"model": "item/curved_sword"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "item/diamond_sword"
}
},
"on_false": {
"type": "minecraft:model",
"model": "item/diamond_sword"
}
}
}

restive pine
last crescent
potent pulsar
last crescent
#

still nothing

#

/give @s diamond_sword[custom_name="Curved_Blade"]

#

that was the command

restive pine
#

(For the name)

last crescent
#

sill noting idk may its the texture that is worng

potent pulsar
last crescent
#

as in the txt is not called diamond_sword

potent pulsar
#

well it should also be a json file not a txt file

#

in this case you can indeed just change the file extension from txt to json and it will work

#

for most files you can't just switch formats like that but for this you can

last crescent
#

its not giving me a option to change it from a notepad txt to a .json

#

idk i feel like nither one of us know what the other means

potent pulsar
last crescent
#

i dont no

potent pulsar
last crescent
#

i do have it enabled and my custom item is named diamond_sword.json but still nothing

#

is there any way we could vc and i share my screan or somthing cuz im still lost

potent pulsar
#

my DMs are open if you want to call me there