Topic category: Help with MCreator software
Hello,
I have a written book assigned to the top left corner of each chest that gets created. I want to put writing in these books, but don't know the proper 'NBT text tag' for it. So far, here is my code. The first object in the 'putstring' function is for the NBT text tag. I tried setting it to 'text' and the second argument to 'This is page 1 of my book.'...
(new Object() {
public ItemStack getItemStack(BlockPos pos, int sltid) {
AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
TileEntity _ent = world.getTileEntity(pos);
if (_ent != null) {
_ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
_retval.set(capability.getStackInSlot(sltid).copy());
});
}
return _retval.get();
}
}.getItemStack(new BlockPos((int) (x + (xval)), (int) (y + (yval)), (int) (z + (zval))), (int) (0))).getOrCreateTag()
.putString("text", "This is page 1 of my book.");
I get...
"Invalid book tag." inside each book.
You can use the text NBT tag and the pages nbt tag to modify it
{pages:['{"text":"Soemthing"}
Reminder that you have to use a serialized Json text for the contents
']
This is my structure. What would I put for "Set NBT text tag" so the books won't say, "Invalid book tag"?
I cant see
I clicked on the image button, and it asks for a URL. I can't seem to upload images from my computer directly.
https://www.pythonanywhere.com/user/EnsurdFrndship/files/home/EnsurdFrndship/structure2.jpg
I am using Java, but don't know how to apply '{pages:['{"text":"Soemthing"}]}' to the structure while working with the visual structure.
I tried...
... but each book still says, "Invalid book tag."
I am assuming that I need the proper "NBT text tag"(s) assigned before my values can create books in Minecraft that doesn't say "* Invalid book tag*" in them when I open them. I just don't know what to put in "Set NBT text tag" when working with the visual structure of my procedure, in order to create books with custom made text in them.
I heard for a 'written book' to be 'valid', there has to be an "author", a "title" and the title has to be under 256 characters. The code (below, which supposedly sets the author and the title) meets all the requirements, and my books STILL say, "* Invalid book tag *"...
I even tried...
not sure
but should you have any further questions,
you can consult Klemen, the Dev