items can be constructed with kwargs

This commit is contained in:
əlemi 2022-01-14 16:25:09 +01:00
parent 8f92743454
commit bdd7160dde

View file

@ -101,7 +101,11 @@ class Item:
nbt : dict nbt : dict
damage : int # This got removed past 1.12.2 damage : int # This got removed past 1.12.2
def __init__(self, item : 'Item' = None): def __init__(self, item:'Item' = None, id:int=0, count:int=0, nbt:dict=None, damage:int=0):
self.id = id
self.count = count
self.nbt = nbt or {}
self.damage = damage
if item: if item:
self.id = item.id self.id = item.id
self.count = item.count self.count = item.count