Main hand observations


I’m wondering what “maxDamage” and “none” vs “air” mean in main hand observations:

    "mainhand": {
            "damage": "Box()",
            "maxDamage": "Box()",
            "type": "Enum(none,air,wooden_axe,wooden_pickaxe,stone_axe,stone_pickaxe,iron_axe,iron_pickaxe,other)"


I believe maxDamage refers to how damaged the tool can get. I.e. If damage = maxDamage, then tool is broken and can not be used (as per Minecraft mechanics).

As for the none and air type: I am puzzled by this as well. Does one of them of never happen (they mean the same thing), or does none mean the player is not able to hit anything (“doesn’t even have hands”)?


Found the answer on github re none and air:

`equip none`  is a no-op action, it does not affect the state of the agent
`equip air`  attempts to equip the item  `air`  which effectively unequips any item the agent is holding

Note that if the agent does not have any space in their inventory (and as such there are no free slots)  `equip air`  will not have any effect. This is a rare case however and we have not encountered this for agents in the competition.
1 Like

Okay so I currently have the problem that type is not always in the Enum:

"type": "Enum(none,air,wooden_axe,wooden_pickaxe,stone_axe,stone_pickaxe,iron_axe,iron_pickaxe,other)

E.g. my program crashed because I suddenly had the observation {‘damage’: 0, ‘maxDamage’: -1, ‘type’: ‘wheat_seeds’}

Before that I always got the observation for mainhand as: {‘damage’: 0, ‘maxDamage’: 0, ‘type’: 0}

Is this a bug? I suppose it would be possible for me to set the type to the int of “other” if it is not among stone_axe etc. but of course it would be nice if this can be fixed for all.