I'm creating a mod that allows the player to select what painting they want to place. When you right click to place a painting, it opens a simple gui that allows you to select the painting that you want. I want to see if I can render the paintings to the player, but the goal is to keep it entirely serverside so this would be accomplished through maps or maybe a resource pack.
#Serverside Painting Selection
20 messages · Page 1 of 1 (latest)
hm I think a resourcepack could do that
There's an rp like that on vanilla tweaks
It took me a long time to figure out the datagen but I got it
Nice
it would be sick if you could add custom paintings too
if you want to do that the normal way without map shenanigans it would require a file upload page, a hosted server resourcepack, and a server restart
it also wouldn't really connect to this menu beyond maybe a button in the menu so it should probably be a separate mod imo
Yeah I actually started running into some hurdles
It was working when on client and server but if you set the custom model for the itemstack and the client doesn't have the resource pack it shows null textures
I couldn't get it to roll back to vanilla without setting up an entire clientside portion of the mod (applying the model clientside and removing the serverside portion that does that), but that's not ideal so I'm gonna try again another day when I haven't been staring at it as much
I would recommend overriding the default painting model to select based on the component painting/variant, instead of changing the item_model component
Can you elaborate a little? When I was working only on the serverside I did:
itemStack.set(DataComponentTypes.ITEM_MODEL, identifier);
and then I used the datagen to make a resourcepack with model and texture info:
-# assets/minecraft/items/alban.json
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/alban"
}
}
and
-# assets/minecraft/models/item/alban.json
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "minecraft:painting/alban"
}
}
Don't set the ITEM_MODEL component and you don't need assets/minecraft/items/alban.json , instead
assets/minecraft/items/painting.json
{
"model": {
"type": "minecraft:select",
"property": "minecraft:component",
"component": "minecraft:painting/variant",
"cases": [
{
"when": "minecraft:alban",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/alban"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "minecraft:item/painting"
}
}
}
that is assuming you're setting the painting variant component
yes I am and that makes sense
wish I had just asked more questions to people lol
I'm not sure if I have time to fix it tn but I really appreciate it 🙏
Ended up finishing so hopefully I can publish soon with fully optional clientside support