#why the texture doesnt apply ingame
153 messages · Page 1 of 1 (latest)
if you put it in /assets/kubejs/... then the texture has to be 'textureAll': 'kubejs:block/bauxite_ore'
otherwise its .minecraft\kubejs\assets\minecraft\textures\block
variants: {
'stage0': {
'textureAll': 'kubejs:block/bauxite_ore',
},
'stage1': {
'textureAll': 'kubejs:block/bauxite_ore'
}
}
doesnt work :(
is the blockstate correct?
event.create('bauxite_ore').material('stone').hardness(3).displayName('Bauxite Ore').blockstateJson = {
variants: {
'stage0': {
'textureAll': 'kubejs:block/bauxite_ore',
},
'stage1': {
'textureAll': 'kubejs:block/bauxite_ore'
}
}
}
blockstateJson
latest version of kubejs, 1.19.2
i just need a yes or a no to my question 
as in are you sure the structure is correct?
yeah
how did you check if its working after changing the texture path
restarted the game
it is a startup script
i have no idea why there's no texture
Jade above shows correct texture
but the block is still missing the textures
show me your latest.log
Paste version of latest.log from @fleet bridge
Exception loading blockstate definition: 'kubejs:blockstates/bauxite_ore.json' missing model for variant: 'kubejs:bauxite_ore#'

?
i was typing it D:

what's that suppose to mean
my knowledge is very limited with assets, so im not entirely sure
i mean
if i were to speculate id say your blockstate maybe needs a model as well
damn
i think the blockstate defines what model to use, and the the model defines what texture to use
event.create('bauxite_ore').material('stone').hardness(3).displayName('Bauxite Ore').blockstateJson = {
variants: {
'stage0': {
'model': 'kubejs:block/bauxite_ore',
'textureAll': 'kubejs:block/bauxite_ore'
},
'stage1': {
'model': 'kubejs:block/bauxite_ore',
'textureAll': 'kubejs:block/bauxite_ore'
}
}
}
still no texture
[30Aug2023 00:10:15.089] [Worker-Main-13/WARN] [net.minecraft.client.resources.model.ModelBakery/]: Exception loading blockstate definition: 'kubejs:blockstates/bauxite_ore.json' in resourcepack: 'KubeJS Resource Pack [assets]' for variant: 'stage1': Unknown blockstate property: 'stage1'
[30Aug2023 00:10:15.089] [Worker-Main-13/WARN] [net.minecraft.client.resources.model.ModelBakery/]: Exception loading blockstate definition: 'kubejs:blockstates/bauxite_ore.json' in resourcepack: 'KubeJS Resource Pack [assets]' for variant: 'stage0': Unknown blockstate property: 'stage0'
[30Aug2023 00:10:15.089] [Worker-Main-13/WARN] [net.minecraft.client.resources.model.ModelBakery/]: Exception loading blockstate definition: 'kubejs:blockstates/bauxite_ore.json' missing model for variant: 'kubejs:bauxite_ore#'
damm
no idea how to fix this stuff

i need it for simple ore block
it should have 2 blockstates
first is default state
second is "mined out" state
ores will essentially require mining it out twice
does the actual block itself have blockstates? because just making the blockstate.json point at models won't give the block blockstates
fuck
yeah thats what's going wrong
"stage0" and "stage1" don't exist, so the models just don't get applied
Stupid idea, but what if you change the texture directory folder called block and rename it to blocks?
For example, I think this is picky and is supposed to be blocks
no, block would be the right one
const $BooleanProperty = Java.loadClass('net.minecraft.world.level.block.state.properties.BooleanProperty')
const $IntegerProperty = Java.loadClass('net.minecraft.world.level.block.state.properties.IntegerProperty')
StartupEvents.registry(.....
event.create('my_block').property($IntegerProperty.create("uses", 0, 2)).property($BooleanProperty.create("empty"));
heres a script for adding blockstates, supposed to go with the block registery
IntegerPropery in this case adds a blockstate called uses that can range from 0 to 2, and BooleanProperty adds a state called empty that can either be true or false
you can modify it for your own block obv
hey
is there any guide on how to properly implement blockstates
like how to properly reference models, textures, etc
or atleast an example
you can take a look at existing stuff to get an idea of it
this is the blockstate.json for the respawn anchor
Paste version of cuo6jrm.json from @eternal swift
so, the model is png, right?
no, the model is a model
like, the shape of the block
is your block just a normal cube?
is there any basic reference
yeah
just a normal ore block
there must be some default model
vanilla has a bunch of basic models you can parent off, like slabs, stairs, cubes, and etc
if you wanna create a custom model youd have to use something like blockbench, but since its just a cube this will do
acacia planks just use a normal cube too
Paste version of 5mMeV1e.json from @eternal swift
change it to reference the right thing obv
question: where am i suppose to put it?
models/block/
i meant the code
inside of a json as well
event.create('bauxite_ore').material('stone').tagBlock('minecraft:mineable/pickaxe').modelJson({
parent: "minecraft:block/cube_all"})
like that?
or am i suppose to make those files somewhere else
event.create('bauxite_ore').material('stone').tagBlock('minecraft:mineable/pickaxe').tagBlock('minecraft:needs_diamond_tool').requiresTool(true).hardness(10).displayName('Bauxite Ore').property($IntegerProperty.create("stage", 0, 1)).blockstateJson = {
variants: {
'stage=0': {
'model': 'kubejs:block/bauxite_ore'
},
'stage=1': {
'model': 'kubejs:block/deepslate_bauxite_ore'
}
}
}
BlockEvents.broken("kubejs:bauxite_ore", event => {
if ((event.player.mainHandItem.hasTag("forge:tools/pickaxes") || event.player.mainHandItem.hasTag("forge:pickaxes"))
&& (event.player.mainHandItem.item.tier.level==3) && (event.block=="kubejs:bauxite_ore[stage=0]") ){
console.log(event.player.mainHandItem.item.tier.level);
console.log(event.block);
event.block.set(event.block.id,{"stage": "1"});
event.block.popItem('minecraft:apple');
event.cancel();
}
})
alright
for some reason, this works
'model': 'kubejs:block/bauxite_ore'
it essentially just uses .png file
.minecraft\kubejs\assets\kubejs\textures\block
\bauxite_ore.png
i have kubejs-forge-1902.6.1-build.370
so 'model' can use basic png, if it is normal ass cube
also this works,
stage=0 is a default blockstate, if you break that block, an apple drops and the block changes its stage to stage=1. if you break stage=1 block, it just breaks
event.block=="kubejs:bauxite_ore[stage=0]"
but
event.block.id=="kubejs:bauxite_ore"
so no block state / blockstate for block.id
Ticket closed!
is there a list of code used for vanilla blocks/items
like for example i want to see how furnace works
code-wise
or how stone breaking works
no clue
you can download kubejs as a zip
then extract it
open powershell/terminal and run ./gradlew genSourcesWithVineflower
itll take an hour or so though
.gradle\loom-cache\minecraftMaven\net\minecraft\forge-1.19.2-43.2.11-minecraft-merged-project-@forge\1.19.2-loom.mappings.1_19_2.layered+hash.40359-v2-forge-1.19.2-43.2.11\forge-1.19.2-43.2.11-minecraft-merged-project-@forge-1.19.2-loom.mappings.1_19_2.layered+hash.40359-v2-forge-1.19.2-43.2.11-sources.jar is where you will find the output (i think)
you can unzip it like a zip
and decompiled and deobfuscuated minecraft sources will be inside!
Thanks, I will try that
Nvm it is gradle
I hate this
?
legally? i dont think so
just tell me what you want to find and ill tell you
whats your problem anyway
??xy
The XY problem is when you really want to do X, and you think that Y can achieve X. However, you can't get Y to work, and so ask for help exclusively about Y.
This can lead to a lot of confusion from the people trying to help you, as Y can seem like a very random thing to want to do, and a lot of the time isn't the best way to achieve X anyway.
Its fine to ask about Y, just always include some context about X so you can be put on the right track if Y won't do X well, or there is an easier way to do X.
Gradle
what do you want to achive by getting mc sources
I can’t make it work properly
Look how some blocks work
why?
Like furnace, for example
yuo still havent answered my question
To know stuff how Minecraft works
Like I want a furnace which melts twice as fast
For example
I don’t know how furnace works
I should look how furnace works
then make the burn time of everything half
again, xy problem
