mineflayer icon indicating copy to clipboard operation
mineflayer copied to clipboard

`entity.kind` is `UNKNOWN` on 1.18.2 server

Open wvffle opened this issue 2 years ago • 3 comments

  • [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

image

wvffle avatar Mar 13 '22 13:03 wvffle

We would need to find a source for this information It used to come from wikis I don't know if burger has it

rom1504 avatar Mar 13 '22 14:03 rom1504

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"

image

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

image

sefirosweb avatar May 05 '22 21:05 sefirosweb

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

Bottinator22 avatar Sep 22 '22 23:09 Bottinator22