#why the texture doesnt apply ingame

153 messages · Page 1 of 1 (latest)

hidden bisonBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

charred meteor
#

what folder is the texture in?

#

whats the full path

fleet bridge
#

.minecraft\kubejs\assets\kubejs\textures\block

#

\bauxite_ore.png

charred meteor
#

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

fleet bridge
#
variants: {
            'stage0': {
                'textureAll': 'kubejs:block/bauxite_ore',

            },
            'stage1': {
                'textureAll': 'kubejs:block/bauxite_ore'
            }
        }
#

doesnt work :(

charred meteor
#

is the blockstate correct?

fleet bridge
#
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

charred meteor
#

i just need a yes or a no to my question heh

fleet bridge
#

uhhh

#

i dont really know

#

wdym by blockstate correct

charred meteor
#

as in are you sure the structure is correct?

fleet bridge
#

yeah

charred meteor
#

how did you check if its working after changing the texture path

fleet bridge
#

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

charred meteor
#

show me your latest.log

fleet bridge
alpine swanBOT
#

Paste version of latest.log from @fleet bridge

white ember
#

Exception loading blockstate definition: 'kubejs:blockstates/bauxite_ore.json' missing model for variant: 'kubejs:bauxite_ore#'

charred meteor
white ember
#

why you angry? :(

fleet bridge
#

?

charred meteor
#

i was typing it D:

white ember
white ember
fleet bridge
#

how

#

why

#

what am i suppose to do in this case

#

i've been following wiki stuff

charred meteor
#

my knowledge is very limited with assets, so im not entirely sure

fleet bridge
#

i mean

charred meteor
#

if i were to speculate id say your blockstate maybe needs a model as well

fleet bridge
#

damn

charred meteor
#

i think the blockstate defines what model to use, and the the model defines what texture to use

fleet bridge
#
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

white ember
fleet bridge
#

hm

#

i dont know any people who know how to get the texture stuff fixed

charred meteor
#

do you need this blockstate for a simple ore block?

#

or why do you need it

fleet bridge
#

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

eternal swift
#

does the actual block itself have blockstates? because just making the blockstate.json point at models won't give the block blockstates

fleet bridge
#

fuck

eternal swift
#

yeah thats what's going wrong
"stage0" and "stage1" don't exist, so the models just don't get applied

coarse jetty
#

Stupid idea, but what if you change the texture directory folder called block and rename it to blocks?

coarse jetty
eternal swift
#

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

fleet bridge
#

is there any guide on how to properly implement blockstates

#

like how to properly reference models, textures, etc

#

or atleast an example

eternal swift
#

you can take a look at existing stuff to get an idea of it
this is the blockstate.json for the respawn anchor

alpine swanBOT
#

Paste version of cuo6jrm.json from @eternal swift

eternal swift
#

no, the model is a model
like, the shape of the block

fleet bridge
#

oh

#

how do i find one

eternal swift
#

is your block just a normal cube?

fleet bridge
#

is there any basic reference

#

yeah

#

just a normal ore block

#

there must be some default model

eternal swift
#

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

alpine swanBOT
#

Paste version of 5mMeV1e.json from @eternal swift

eternal swift
#

change it to reference the right thing obv

fleet bridge
#

oh damn

#

alright!

fleet bridge
eternal swift
#

models/block/

eternal swift
#

inside of a json as well

fleet bridge
#
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

fleet bridge
#
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

fleet bridge
#

'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

fleet bridge
#

event.block=="kubejs:bauxite_ore[stage=0]"

#

but

#

event.block.id=="kubejs:bauxite_ore"

#

so no block state / blockstate for block.id

fleet bridge
#

like for example i want to see how furnace works

#

code-wise

#

or how stone breaking works

eternal swift
#

no clue

dusk ruin
#

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!

fleet bridge
#

Thanks, I will try that

fleet bridge
#

I hate this

dusk ruin
#

?

fleet bridge
#

Is there other way to get decompiled Minecraft

#

It always doesn’t work for me

dusk ruin
#

legally? i dont think so

#

just tell me what you want to find and ill tell you

#

whats your problem anyway

#

??xy

alpine swanBOT
# dusk ruin ??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.

fleet bridge
dusk ruin
#

what do you want to achive by getting mc sources

fleet bridge
#

I can’t make it work properly

fleet bridge
dusk ruin
#

why?

fleet bridge
#

Like furnace, for example

dusk ruin
#

yuo still havent answered my question

fleet bridge
#

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

dusk ruin
fleet bridge
#

Nvm

#

I am far from my pc