Jump to content

How to make Contextual ToolTip appear on Block?

Recommended Posts

Hello! Hope everyone is having fun.

How do you make the contextual tool tip that appears when you hover over blocks? I've read over the wiki, but could have missed it.

For example, when you look at a berry bush, it gives you a tool tip that says "right click to harvest" for the player. How do you enable that for a custom block in a mod? I've seen a bunch of mods that have these help items. I can find their text in the en.json language file. Like this.

"viesblocks:helpitem-windowbig-2": "Cycle through different variants",

But....I can't find where you associate that with a certain block. Is it part of the API? Fine if solution is in C#. What am I missing?

Link to comment
Share on other sites

11 hours ago, pencilgame said:

World Interaction! You're a legend. That link will also be a treasure trove of examples. What a class act. Thank you.

For anyone who doesn't have github:

fwiw, I never direct anyone to the api docs because they are auto-generated and difficult to navigate.  And while the Anegostudios github is convenient for pointing people towards and searching, it is missing half of the resources that one might want to look at (and also pretty clunky).

Using a decompiler like dnSpy or ILSpy (or Visual Studio has a plug in apparently) is so much better than the other two resources.  I use dnSpy myself. Run it, drag and drop all the relevant .dll files into it (i.e. VintagestoryAPI, VintagestoryLib, VintagestoryServer, plus everything in the Vintagestory\mods folder), and Bob's your uncle.

Edited by Spear and Fang
Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.