ItemEvents.dynamicTooltips


You can add dynamic tooltip handler to an item, which on client side gets called every frame you look at the tooltip, with access to item
Example adding mod name to all item tooltips while ALT key is pressed:
ItemEvents.modifyTooltips(event => {
	// When alt key is pressed, show 'mod_id' dynamic tooltip
	event.modifyAll({alt: true}, tooltip => {
		tooltip.dynamic('mod_id')
	})
})
ItemEvents.dynamicTooltips('mod_id', event => {
	// Add mod name to tooltip
    event.add(Text.blue(Platform.getInfo(event.item.mod).name))
})