The IItemRightClick function can be added to an Item and will be triggered when a user does rightclick with the item selected in his primary hand.

Importing the package

It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import mods.contenttweaker.IItemRightClick;


The IItemRightClickFunction is a function with the following parameters:

The function needs to return either "SUCCESS", "PASS" or "FAIL"


zsItem.itemRightClick = function(stack, world, player, hand) {
    Commands.call("scoreboard players set @p name 5", player, world);
    return "Pass";