Started by
Max094_Reikeb
on
Topic category: Help with Minecraft modding (Java Edition)
Hello,
I'm just trying to add a description to a tool, not an item. The MCreator interface doesn't have this for tools that's why I'm asking.
My MCreator version : last 2020.2 snapshot
My MC version : 1.14.4
So I've been trying several codes but none work.
// First trial
public void addInformation(ItemStack itemstack, World world, List<ITextComponent> list, ITooltipFlag flag) {
this.addInformation(itemstack, world, list, flag);
list.add(new StringTextComponent("Test"));
}
//Second trial
public void addInformation(ItemStack itemstack, World world, List<ITextComponent> list, ITooltipFlag flag) {
super.addInformation(itemstack, world, list, flag);
list.add(new StringTextComponent("Test"));
}
//Third trial
public void addInformation(ItemStack stack, World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
tooltip.add("Test");
super.addInformation(stack, worldIn, tooltip, flagIn);
}
Thanks for any help!
Edited by Max094_Reikeb on Wed, 03/25/2020 - 16:16
Please, anyone to help me?
problem solved on my own.
How did you do it?
this is how i like to run my tool tips its on my melon juice its a nice way to run it if you want them to hold shift to view the information you just need to create a KeyboardHelper class i have in util/helpers
make a nice tool tip say if u have a fair bit of information you can have a little keybind while hovering item to show more information
You can actually do this without code in 2020.3
this is the java eclipse code ive used for mc 1.15.2 but it can be a guide on how it works some coding may be a bit different but with any coding experience should not be hard to make a copy of it to the code that works via any other versions of mc
ahh so .3 has the implementations so no code needed nice
tooltip.add(new StringTextComponent("Melon Juice Heals 3 Meat Peices"));
You spelt pieces wrong.
tooltip.add(new StringTextComponent("Melon Juice Heals 3 Meat Pieces"));
i over looked that thanks lol ill sort that xD