Add NBT custom name lookup

This commit is contained in:
2023-03-21 13:32:56 -05:00
parent 14bd08b16c
commit 0f4fe2bb81

View File

@@ -20,6 +20,13 @@ local function ItemStack_new(item)
end
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()
end