You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 14, 2020. It is now read-only.
Hampus Joakim Nilsson edited this page Aug 3, 2012
·
1 revision
Returns the name of the thing.
[[String]] [[Thing]].getName()
Return Value
Returns the name of the thing. This is either the name of the item (without the count / article) or the name of the player / creature.
If you want the name of an item including the article, use Item.getLongName.
Examples
A simple command that displays the name of the item in one of the player's hands.
localcmd=Command:new("GetItemName")
cmd.words="/getitemname"functioncmd.handler(event)
event.creature:sendNote("You are holding '" ..event.creature:getInventoryItem(SLOT_HAND) .."'.")
end-- Registers the name of the itemcmd:register()