Posted December 24, 20222 yr I have a custom entity that is animated using GeckoLib. Is it possible to display/render text on that entity's side for example, and how to do that? Thanks. Edited December 24, 20222 yr by RInventor7
December 24, 20222 yr This is not the Geckolib support forum. Questions about geckolib should be asked wherever they provide support. But you can display anything you like on any entity by writing your own layer and registering it using EntityRenderersEvent (see the subclasses). There is no vanilla implementation of the behaviour you want, but you can find code to do it EntityRenderer.renderNameTag() Layer is to EntityRenderer as Widget is to Screen. Edited December 24, 20222 yr by warjort Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
January 3, 20232 yr Given a GeoModel you can retrieve bone positions relative to the origin of the model. Here is a little example I made that was used to render an item that was "stuck to the bone": - this is in kotlin and was for a tile entity. Use the concept behind this to render text at the positon of the desired bone /** * Add custom rendering code here outside geckolib's animation system */ override fun renderFirst( tile: ChamberTile, model: GeoModel, stack: PoseStack, buffer: MultiBufferSource, packedLight: Int ) { val rootBone = model.getBone("root") rootBone.ifPresent { bone -> val rot = Math.toDegrees(abs(bone.rotationY).toDouble()) * 2 stack.pushPose() stack.mulPose(Vector3f.YP.rotationDegrees(rot.toFloat())) stack.translate(bone.positionX.toDouble(), bone.positionY.toDouble(), bone.positionZ.toDouble()) //Do world text rendering here (look at player name tag render code) //anything rendered at this point will be relative to the selected bone stack.popPose() } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.