This tutorial demonstrates how to add custom tooltips to items and blocks in Minecraft Fabric modding by overriding the appendHoverText method, which is a client-side feature that displays additional information when hovering over items. The video shows how to implement conditional tooltips that change based on player input (like holding shift), use Java anonymous classes for efficient item customization, and apply method overloading with varargs to add tooltips to blocks. Tooltips are purely client-side features, meaning they only affect the player's screen and don't require server-side processing.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Fabric Modding Tutorial - Minecraft 26.1: Custom Tooltips | #12Added:
Let's add custom tooltips to our Minecraft mod. If you want to go deeper, the 26.x modding courses are linked down below. 30+ hours covering complex block entities with fluid and energy handling, custom mobs, custom networking, and even custom biomes and dimensions. Everything you need for 26.x all in one place, linked down below in the description.
All right, we found ourselves back in Tele world and more and in this tutorial we'll be adding custom tooltips not only to our items, but also actually to one of the blocks. But I'm going to see that in a second. For the time being, the idea of tooltips is as follows. You hover over a an item in your inventory and you get additional data or additional information that is basically written inside of the tooltip under its name. Now, usually how this works is you override a method with in an item class.
Now, what we can do actually right here inside of our chisel item, we can actually override this. There's no reason why we couldn't. So, in this instance, we're actually just going to do that. So, we have overwritten the use on method before and now we're going to override the append hover text method.
You'll see the strike through over here though, which basically means that the method itself is deprecated. It actually when we hover over this, you can see overrides deprecated method in the item class. Now, we can still use this. This should be okay. Um I do wonder if they are using it the same way that um yeah, okay. So, this is actually being used the same way that the rest is used.
So, usually when there's a new tooltips being added via the item stack, cuz obviously they need to be added to the stacks, then what happens is that it just calls the append hover text method to the item. So, that's how basically it gets added. You can see though that they changed this to basically data components and it might be the case that, you know, sometime in the future they might actually change this to a custom data component of some kind. So, just be aware that that might possibly be a thing. Definitely though here in this case, the append hover text still works and even though it is deprecated, is as far as I know, it is still the preferred version of how to add a custom tooltip. Now, what we're going to do is we're going to make something really freaking cool and that is we'll make it so that you can actually hover over the chisel and it's going to say something like press shift for more information and then you hold down shift and then it shows something else. That in my opinion is really freaking cool and this is super easily achieved with the append hovertext method because that is a purely client-side method because there's never a reason why you need to show the hovertext on the like on the on the server. Like it doesn't even make any sense. Like what does that mean to show it on the server? Cuz like the server doesn't have any rendering. Like it just knows a block is at like position, you know, 333 but like how the block looks like, that's determined by the client, right? So and and then here it gets even in more interesting cuz to basically see when we press shift down or hold shift down, I mean say Minecraft is from net Minecraft client, it does kind of tell you already that this is a client class, but let's say, right? We get the instance over here and then we call the has shift down method. Now, here it actually starts to if you just think about it logically, you should think about this in the way where it's like, well, what does it mean to have the shift down? Well, it obviously means that you hold shift on your keyboard, right? Okay, for a client, this makes total sense. What would that mean for the server, right? So sometimes you can even just get this sort of server-client dynamics understood just by pure logic.
It's like what would it mean to have shift down if we would were be on the server? Like if we would be on the server and this was a method that we could call on the server, which obviously it isn't, but let's just suppose, then what would that mean?
Every single player has to have shift down? That doesn't make any sense. It's like and and anything else doesn't make any sense because the server doesn't know which client just pressed shift, so the whole point becomes moot. Obviously, this is pure client-side. And to add this now, it's unbelievably simple. We simply want to call builder.accept right here and then inside we will talk pass in a translatable component so component.translatable and then let's say here for example tooltip.tutorialmod.chisel.shiftdown because this is the one when that's going to be displayed when we have shift down. And then the other one we're just going to copy this over right here as per usual of course the code is available to you down below and there we go. And this is then what's going to be displayed when we actually are not pressing shift so this should say something like press shift for more information. So I'm going to say press and then here we're going to use the section symbol e so section symbol small e shift this is the normal word shift right and then we do the section symbol r and that is going to be this is a formatting code used to well basically format this in a different way that's going to make it yellow I believe. So that's the idea. I will link down below also the different formatting codes you might have seen this previously if you've ever worked with signs and you you assign like this different colors of those. There's also rainbow and all sorts of other things in terms of formatting codes but there we go. So we add this one over here the hover over to add the translation is of course a thing from the Minecraft development plugin. So theoretically you can get it there and then that just adds it automatically to the en_US.json file. Shift down will then be basically something like chisels block into other blocks. I mean that that's an app description for the for the chisel item I would say and then we can see that this is added right here down here boom. Maybe we want to remove the dot over there but there we go right so that's the idea. So we have the shift where we show basically press shift for more information and then this chisels blocks into other blocks very straightforward. However we run into an issue if let's say for example for the strawberry we wanted to now add a hover text right and we want to add a tooltip to it how would we do that? Well now it gets interesting because may you know obviously you don't I don't make a new class every single time Like imagine you want to add this to all of your different items for just whatever reason, it doesn't matter, but you want to do this for all items. Well, luckily, here's something that is deep within Java comes to our rescue, and that is the anonymous class. Now, if you don't know what an anonymous class is, that is another really good sign that maybe a little bit more Java knowledge should be, you know, gotten. Just a recommendation over here, cuz I do talk about the anonymous classes in my uh in my tutorial as well, like in the Java tutorial series. And the idea is just that anonymous class is basically we're overriding the item class in line, so you can see I literally just added after the new item constructor here, the curly bracket, and now this is the inside of my new class that that basically extends the item class, and it is called anonymous because it doesn't have a name, right? We don't have this that we didn't call this the strawberry item or whatever, but inside of here, we can still override the append hover text method, and that's exactly what we're going to do. And we're going to literally just say then the builder.accept, and we're going to accept the um component.translatable tooltip.tutorialmod.
And let's do do the strawberry. There we go. And then we can just hover over this again if you have the Minecraft development plugin, and then add it as a translation. Let's say this is delicious. Um I just have to write it correctly. Is this correct? Delicious.
Sure. I think it is. Okay, there we go.
And that's the strawberry over here.
Now, you might say that's all fine and well, but I actually really really really desperately need to add a translation to my blocks, right? Uh or not a translation. Oh, wait. Yes, a translation as well in the second, but actually I need to add a a tooltip to my blocks. How would I do this? Well, luckily, in the blocks we are making a new block item right here, and what we're going to do is we're going to duplicate both the register block and the register block item methods. Now, copying them over is going to have all sorts of errors thrown our way. Not to worry, because what we can do is we can simply change the method signature. So, let's say in the register block over here, we're going to add components, making sure we choose the one from, you know, component from net.minecraft.network.chat, component.dot.dot.dot, which we're going to call the tool tips, I guess. That's fine. And we'll do the same thing for the register block item method over here, and then passing those into here as well. So, there's going to be the tool tips. You can see the register block method Now, the top one has the component.dot.dot.dot tool tips passed into the register block item method, which also has those tool tips.
Now, why can we do this? Because this is normal thing called method overloading.
I think I've explained it in the Java introduction. I'm actually not 100% sure if I did.
I I if I just like think about this, I don't know if I've actually explained this. But basically, we can have a second, like the same named method over here, just with a different method signature. Meaning, in this case, we have a different number and different types of parameters. And that just then it figures out, okay, I know exactly what you mean now, and I know exactly which one we should call. Now, we still need to change it in the register block item method though, of course, when we create this block item. That is, when we make this anonymous class right here, and we simply once again append hover text, and just like that, we are good to go. Now, in this case, because we're doing a dot.dot.dot, this is sort of like it's like passing a list of of tool tips right here, right? So, it's it's like a little bit of a different thing, but basically, it's not a list, but you can just add multiple if you want to. I just think it's better this way to have it a little bit more, or what do you say? It's just safer for if you actually do want to add multiple, it just makes sense to do dot.dot.dot in this case.
And this is going to be a for loop for var component, component, in tool tips, right? So, this is just going through the parameter over here, and then we're going to add every one of those. So, builder.accept, passing in that component. And because this is just a normal, you know, components list over here, a component dot dot dot like I said. There's a There's a There's a term for it that it just does not It doesn't come to me right now. I I don't know. It is called a var args. I knew that that was a thing. So, that's basically the idea of arbitrary number of values. So, I guess that's what it is. I don't know if that's what actually was like on my mind, but it doesn't matter. Basically, you can just add as many components here at the end as you want. That's the whole idea. With that being said, let's to the magic block over here just do that exact thing. So, we're just going to add a component.dat translatable and this is going to be the tooltip.tutorialmode.magic_block.
Now, obviously, we do want to call it into the register block method call and not the new magic block over here cuz that does not work. We can just add it to the magic block. And then here we're going to say something like this block that seems white and then let's do another one e no nine magic Oh, there we go. That's going to make it Let's You know what? Let's do a different color.
Let's do a two. Let's I don't know what color that is, okay? I always do nine here for magical. Let's make it a two.
And yes, by the way, I can type this symbol so easily because on the German keyboard, if you press shift and three, it types that symbol.
Yeah, it's a section symbol for for laws. Should tell you lots about Germany, but regardless though, that is this block seems quite magical. There we go. And there we have it. Either you can just copy it over or you just search for a section symbol. Either one works fine.
Then you I shouldn't I think with section symbol you should find it. It's like this double S sort of a thing.
Yeah. There we have it though. Those are all of the, you know, custom tooltips added right here in this case. So, everything that we've that we've added over here pretty freaking neat. I I really You're going to really enjoy this one, but we don't need to run any data to do it It's just going to be added normally. So, I would say let's load up the game and see if it works. All right, everyone's back in Minecraft again and let's take a look. Look at that. Press shift for more information. And if I hold down shift, boom, chisels blocks into other blocks. This is something you 100% have seen before, right? Where there's a couple of different mods that, you know, have like you hold alt or you hold like shift, and then you get more information. This is super useful for this. The strawberry also is quite delicious, which is pretty good, and the magic block is, well, I guess green.
Block seems quite magical. There we go.
That is custom tooltips added to Minecraft. Awesome. And that's going to be it for this tutorial right here.
Remember that the stone brick supporter tier on the YouTube memberships is going to get you 14 days of early access, including the next video, which is going to be a custom tags. Hope to see you there. So, yeah.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
🚀 BCS613C Compiler Design | Module 1 to 5 Schema Evaluation 🔥 | VTU 6th Sem 💯 #VTU #bcs613c #exam
Pranavaa-y4y
104 views•2026-06-02











