Advanced Peripherals

Advanced Peripherals

29M Downloads

scanEntities(range) table missing health fields

DaymasS opened this issue · 0 comments

commented

Describe

Some passive mobs like chicken, sheep, horse, cow (may be more), Do not have health and maxHealth fields in the table that function scanEntities(range) returns.

Steps to reproduce

  1. Connect "environmentDetector" to a computer
  2. Summon some passive creatures (chickens, sheep, ...)
  3. Call scanEntities(range) from the detector
  4. Look through the returned table
local scanner = peripheral.wrap("environmentDetector_0")
local SEARCH_RADIUS = 128

file_handler = io.open("out", "w")
io.output(file_handler)
for _, entity in pairs(scanner.scanEntities(SEARCH_RADIUS)) do
    for field, value in pairs(entity) do
        if (field == "name" or field == "health") then
            io.write(field .. " : " .. tostring(value) .. "\n")
        end
    end
    io.write("-----\n")
end
io.close(file_handler)

изображение

Multiplayer?

No

Version

1.19.2-0.7.34r (Latest 1.19.2)

Minecraft, Forge and maybe other related mods versions

Froge - 43.3.8; MC - 1.19.2

Screenshots or Videos

No response

Crashlog/log

No response