Add NBT custom name lookup
This commit is contained in:
@@ -20,6 +20,13 @@ local function ItemStack_new(item)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ItemStack:getName()
|
function ItemStack:getName()
|
||||||
|
--- check for custom name
|
||||||
|
if self.data.hasTagCompount() then
|
||||||
|
local nbt = self.data.getTagCompount()
|
||||||
|
if nbt.value.display and nbt.value.display.value.Name then
|
||||||
|
return nbt.value.display.value.Name.value
|
||||||
|
end
|
||||||
|
end
|
||||||
return self.data.getName()
|
return self.data.getName()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user