nbtlib
nbtlib copied to clipboard
nbtlib.Long can not set 64bytes value
a Long use 64 bytes cannot run ,error is "btlib.tag.OutOfRange: Long(14757395258967641292) is out of range"
A Long tag is a signed 64bit integer. The maximum allowed value is 9223372036854775807. Your value would fit in an unsigned 64bit integer. nbtlib has a from_unsigned helper for encoding unsigned integers into signed NBT tags
from nbtlib import Long
print(Long.from_unsigned(14757395258967641292))
Long(-3689348814741910324)
You do the opposite with as_unsigned
from nbtlib import Long
print(Long(-3689348814741910324).as_unsigned)
14757395258967641292