Add NBT custom name lookup
This commit is contained in:
parent
14bd08b16c
commit
0f4fe2bb81
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue