#help: custom model based on written book title

38 messages Β· Page 1 of 1 (latest)

eternal niche
#

(this has nothing to do with optifine, since we can now do CIT in vanilla, this question is about Vanilla CIT formatting, but here's no tag for that)

we use to use the Custom Roleplay Data datapack to apply custom model data numbers to items to apply custom models.

but it is no longer updated to the current version of minecraft, so we are switching to just renaming items to apply the custom models.

I've got it working for every item, sorta, written books are being stupid

the attachment is a working format for renaming an item - this works fine!
but i can't just do the same thing for written books. a book title onetwothree, will not change texture unless i then go to an anvil, and rename it. which is just plain silly since the ALREADY come with a custom name,
but using written_book_content instead of custom_name does nothing but give me magenta and black boxes.
I've tries a few other slightly different formats and paths, but none of them are working.

any help would be super appreciated.

trim groveBOT
#
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.

abstract yacht
eternal niche
#

i think I've already tried that, but i honestly can't remember.... gimme a bit to load everything up...

eternal niche
abstract yacht
#

item_name is the default item name usually (or if you overwrite the item_name component via a command)
custom_name is the name given via anvil (or a command again)

#

hence why those two don't work in this case I guess

#

ah, I think it is part of written_book_context (assuming we are talking about a signed book):

{
  "model": {
    "type": "minecraft:select",
    "property": "minecraft:component",
    "component": "minecraft:written_book_content",
    "cases": [
      {
        "when": [
          {"title": "froot loops"},
          {"title": "Froot loops"},
          {"title": "Froot Loops"}
        ],
        "model": {
            "type": "model",
            "model": "item/food/frootloops"
        }
      }
    ]
  }
}```
eternal niche
#

i think i've tried that format already, but lemme check again....

#

(i have tried SO MANY variants and formats πŸ˜…)

#

nope, that just gives me magenta and black boxes again....

#

adding the actual file incase i'm making a stupid typo somewhere....

#

the notexture texture makes me think that the

        "property": "component",
        "component": "written_book_content",```

bit is somehow incomplete because it's not even going to the fallback.
abstract yacht
#

Are there any errors in the output log when you (re)load the pack?

eternal niche
# abstract yacht Are there any errors in the output log when you (re)load the pack?

[Worker-Main-20/ERROR]: Couldn't parse item model 'minecraft:written_book' from pack 'file/platyllamacat_resources 26.zip': No key author in MapLike[{"title":"123"}]; No key author in MapLike[{"title":"onetwothree"}]; List must have contents; No key author in MapLike[{"title":"Statues v2.12"}]; No key author in MapLike[{"title":"Statues"}]; No key author in MapLike[{"title":"statues"}]; List must have contents; Empty case list

#

looks like it wants the author too for some reason, how would that work?

eternal niche
#

ok, changing it to

"when": [{"title":"onetwothree", "author":"Alien_Sunset"}, {"title":"123", "author":"Alien_Sunset"}],

fixed the warning and the magenta and black boxes, but did not in fact apply the custom texture, so there's still somethign going wrong

#

also rises teh issue of the fact that I don't want the textures to be dependent on author, having to add every player on teh server to the file seems a bit much

#

(also, changing the name to lower case did nothing either)

abstract yacht
#

yeah, weird that the author is a required one πŸ€”

eternal niche
#

curious if I was missing something I opened up nbt explorer, this is the book that should have a new texture, but doesn't.... everything seems to be matching, i don't know why it isn't working.

abstract yacht
#

try

        "when": {
          "title": {
            "raw": "statues"
          },
          "author": "Alien_Sunset"
        },```
eternal niche
#

no warning, no magenta and black boxes, but also no custom texture

#

at this point i'm about to just give up and go with custom name, because this is kind of getting ridiculous.

abstract yacht
#

I assume you tried it with "onetwothree", not with "statues", right?
-# cause I just noticed I forgot to replace that in my snippet

eternal niche
#

poking the wiki again for inspiration....
perhaps it needs to be "condition" instead of "select"
If I'm reading it correctly all the fields are optional for the written book contents under condition.
but I'm not 100% sure how to lay the json out for that....
it's a boolen so i need an "if true" and "if false" right? and the false would just be the fallback? or do i chain the different textures?

abstract yacht
abstract yacht
# eternal niche poking the wiki again for inspiration.... perhaps it needs to be "condition" ins...

would look something like this with condition in theory:

{
  "model": {
    "type": "minecraft:condition",
    "property": "component",
    "predicate": "minecraft:written_book_content",
    "value": {
      "title": "onetwothree"
    },
    "on_true": {
      "type": "minecraft:model",
      "model": "draft:draft"
    },
    "on_false": {
      "type": "minecraft:condition",
      "property": "minecraft:component",
      "predicate": "minecraft:written_book_content",
      "value": {
        "title": "123"
      },
      "on_true": {
        "type": "minecraft:model",
        "model": "draft:draft"
      },
      "on_false": {
        "type": "minecraft:model",
        "model": "minecraft:item/written_book"
      }
    }
  }
}```
(unless author becomes mandator again for some reason)
#

(instead of draft:draft it would be your model)

eternal niche
eternal niche
#

seriously, thank you a ton for taking the time to work though this with me, i super appreciate it. πŸ’œ

abstract yacht
#

weird that the other one didn't work, but this one did πŸ€”
but I guess it's good as long as it works πŸ€·β€β™‚οΈ

eternal niche
#

yeah, i don't get it, but for now this works so :: shrug ::

I had initially gone looking for other packs that did something similar to what i wanted and all i could find were things for enchanted books, and I was wondering if wanting to reskin written books was really such a niche thing, but i guess it's more likely that just nobody else could figure it out either πŸ˜…

thanks again though, you rock. πŸ˜„