Skip to content

Create a shiftable tooltip

Loris P edited this page Jan 6, 2023 · 3 revisions

Informations

The lib provide a quick and easy method to have a "Press SHIFT to get more informations" tooltip.

To start

Item

When you create a item, a custom, you extend your class to Item from net.minecraft.world.item.Item But here, you will extend it to the class Item but from fr.ninedocteur.ninetylib.api.content.item.Item

Block

When you create a item, a custom, you extend your class to Item from net.minecraft.world.block.Block But here, you will extend it to the class Item but from fr.ninedocteur.ninetylib.api.content.block.Block

Add the information

In your item's/block's class constructor, add this line :

this.addShiftableInformation(Component);

Finished! See, quick and easy! Let's try it!

Clone this wiki locally