You can make an ICustomModelLoader.
Point the ResourceLocation to a custom IModel, that points to a custom IBakedModel.
In the IBakedModel's getQuads method, provide the list of BakedQuad's to render for the given side.
Do note, only calculate the BakedQuad's once, and store them somewhere. It's quite expensive to re-calculate every frame.
args was length 0, so attempting to access index 0 threw an ArrayIndexOutOfBoundsException.
You're already checking if the length is 0 before printing the help text, you just need to return from the function after doing that instead of trying to access index 0.
That chat message is sent when ICommand#execute throws an exception. The exception is logged when this happens, so look at the log to see what happened.
Each tag in the
"pages"
list must be the JSON representation of an
ITextComponent
. For a
TextComponentString
, you can simply wrap the contents in quotation marks (e.g.
new NBTTagString("\"Page one text\"")
).
If you want anything more complex than plain text, I suggest you create the
ITextComponent
for each page and then use
ITextComponent.Serializer#componentToJson
to serialise them.