Closed Omeganx closed 9 years ago
Hi Omeganx,
The type
parameter in TAG_List should be a class, not an instance.
If you replace vill = TAG_List(type = TAG_Compound())
with vill = TAG_List(type = TAG_Compound)
, things may work. Let me know if that works for you!
I must admit that the error message is not very informative. Any suggestion for a more helpful message are appreciated :)
import nbt
from nbt.nbt import *
villages = NBTFile()
villages.name = "Data"
data = TAG_Compound()
data.tags.extend([
TAG_Int(name="Tick", value=14694297)
])
vill = TAG_List(type = TAG_Compound)
vill.name = "Villages"
villages.tags.append(vill)
villages.tags.append(data)
print(villages.pretty_tree())
Yeah It does work. Thank you a lot, you replied so quickly. Ah ah, I don't really know about the error message, as I said I'm just a beginner, and I thought it would help with the error message. and again, thanks for the time you took to answer me.
So I'm having this problem, I think the problem comes from me but that seems so illogical, So I'll leave that here hoping someone would help me. If I replace
vill = TAG_List(type = TAG_Compound()
with an other tag type, for examplevill = TAG_List(type = TAG_Int())
It will work... (Please notice that's I'm just a python beginner) the code:The Error message: