mineflayer
mineflayer copied to clipboard
`entity.kind` is `UNKNOWN` on 1.18.2 server
- [x] The FAQ doesn't contain a resolution to my issue
Versions
- mineflayer: 4.1.0
- server: vanilla/spigot/paper 1.18.2
- node: 17.6.0
Detailed description of a problem
When trying to check for the hostile mobs, I realized that the kind
is in most cases (if not in all) UNKNOWN
Expected behavior
entity.kind
should represent its kind
Additional context
We would need to find a source for this information It used to come from wikis I don't know if burger has it
hi @rom1504 in entities.json appears correctly the hostile mob: https://github.com/PrismarineJS/minecraft-data/blob/d9f34c105be018d757491fab6a9ba5c5c652481b/data/pc/1.18/entities.json#L389
But the part of code for get this info seems is not modified from a 5 years ago, but now returns category "unknow" instead type "hostile"
I'm trying to find if in other part of code has been changed,
https://github.com/PrismarineJS/mineflayer/blob/9497b67d85082317bf7bf7a19427ed9371cb2f49/lib/plugins/entities.js#L181
We can fix modifiing this line to:
entity.kind = entity.type === 'mob' ? entityData.type : entityData.category
But im not sure if that affect other process
1.17 doesn't have the category at all as well this would probably lead to some problems, as type could be "hostile" and category instead be "Hostile mobs"
Furthermore, hoglins are hostile, but the type in that list classifies them as an animal