#Item textures like thermal coins
71 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
the count predicate is not default minecraft, it's registered by coth
in the original thread there was a fix posted, let me find that
I have it here ``` StartupEvents.postInit(event => {
if (!Platform.isClientEnvironment) return;
const $ItemProperties = Java.loadClass('net.minecraft.client.renderer.item.ItemProperties')
$ItemProperties.register(Item.of('kubejs:research_point'), new ResourceLocation('count'), (stack, world, living, seed) => {
return stack.getCount() / stack.getMaxStackSize()
})
})```
oh
It is in the block_items creation script at the bottom
I will try it. It can take some time, it is a rather big modpack
Nope still not working
I think I see the issue
What is it?
you're making the items use the model as the their texture
and also in the first item it's invalid
also, you should move them into the item folder so that it's the default
(now they're in .../kubejs/models/, whereas they should be in .../kubejs/models/item/)
So I have to move them and that fixes it?
But I need the .texture because the item id is not the same as the models name because I want to make 5 diffrent ones
you don't understand
you can't set the items model using texture
they are two different things
Can I do .model() then?
Ok and the json is replaced by the name of the model or the stuff that I put in the model json file?
2
This will be a mess....
I will put it in its own js file
Does that code have to be in the same file?
no
The textures work now, but the count seams to have no effect
@deep hound your fix doesn't seem to be working
Bruh
Is the resource location for the item actually kubejs:research_point?
it's not
event.create('research_point1').texture('kubejs:research_point').color(0, 0x0000FF).displayName('Research point tier 1')
event.create('research_point2').texture('kubejs:models/research_point').color(0, 0xFFFF00).displayName('Research point tier 2')
event.create('research_point3').texture('kubejs:models/research_point').color(0, 0x800080).displayName('Research point tier 3')
event.create('research_point4').texture('kubejs:models/research_point').color(0, 0xf82c00).displayName('Research point tier 4')
event.create('research_point5').texture('kubejs:models/research_point').color(0, 0x00FF00).displayName('Research point tier 5')
because that method requires you set it for each item individually
^ a fragment of their script
Change it to this then
$ItemProperties.registerGeneric(new ResourceLocation('count'), (stack, world, living, seed) => {
return stack.getCount() / stack.getMaxStackSize()
})
I doubt it
return stack.getCount() / stack.getMaxStackSize()
})
$ItemProperties.register(Item.of('kubejs:research_point2'), new ResourceLocation('count'), (stack, world, living, seed) => {
return stack.getCount() / stack.getMaxStackSize()
})
$ItemProperties.register(Item.of('kubejs:research_point3'), new ResourceLocation('count'), (stack, world, living, seed) => {
return stack.getCount() / stack.getMaxStackSize()
})
$ItemProperties.register(Item.of('kubejs:research_point4'), new ResourceLocation('count'), (stack, world, living, seed) => {
return stack.getCount() / stack.getMaxStackSize()
})
$ItemProperties.register(Item.of('kubejs:research_point5'), new ResourceLocation('count'), (stack, world, living, seed) => {
return stack.getCount() / stack.getMaxStackSize()
})```Can I also just do this? I will only add those 5 items with it
That works too
Ok thanks
~~but ⬆️ is shorter
~~
I don't want to take unnecessary loading time or ram usage
Every item in the game already has at least 3 predicates
I will just send you my whole kubejs folder if this is ok
I guess that works
And...?
be patient
Not completly sure, everything looks right
So... am I screwed?
oh
You have your models in items but you are referencing /item/
So just rename the kubejs/models/items folder to kubejs/models/item
Thanks a lot
