From bdd7160dde27619eb0178a01d12111b07b510c2e Mon Sep 17 00:00:00 2001 From: alemidev Date: Fri, 14 Jan 2022 16:25:09 +0100 Subject: [PATCH] items can be constructed with kwargs --- aiocraft/mc/definitions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aiocraft/mc/definitions.py b/aiocraft/mc/definitions.py index 9fc23ae..20f2092 100644 --- a/aiocraft/mc/definitions.py +++ b/aiocraft/mc/definitions.py @@ -101,7 +101,11 @@ class Item: nbt : dict 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: self.id = item.id self.count = item.count