A simple way to replicate vanilla tooltips, including the yellow mod names. Add an additional optional parameter "tooltip_path" in LuaGuiElement.add.
An additional concept is also needed: TooltipPath.
tooltip_path :: TooltipPath (optional): Path to the object whose tooltip will be used as the tooltip of this element. It is used only if "tooltip" is not provided.
TooltipPath : It is specified by string. It is the path of the interested object whose tooltip will be displayed. It is in form "type/name". Supported types are:
- "item" - for example "item/iron-plate" is the tooltip of iron plate item.
- "entity" - for example "entity/small-biter" is the tooltip of small biter entity.
- "recipe"
- "technology"