Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scanEntities(range) table missing health fields #592

Closed
DaymasS opened this issue Apr 24, 2024 · 0 comments · Fixed by #595 or #626
Closed

scanEntities(range) table missing health fields #592

DaymasS opened this issue Apr 24, 2024 · 0 comments · Fixed by #595 or #626
Assignees
Labels
bug Something isn't working Fixed/Added in dev
Milestone

Comments

@DaymasS
Copy link

DaymasS commented Apr 24, 2024

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

@DaymasS DaymasS added bug Something isn't working needs review Needs review from an Contributor labels Apr 24, 2024
zyxkad added a commit to zyxkad/AdvancedPeripherals that referenced this issue Apr 25, 2024
@SirEndii SirEndii linked a pull request Apr 26, 2024 that will close this issue
3 tasks
@SirEndii SirEndii added Fixed/Added in dev and removed needs review Needs review from an Contributor labels Apr 26, 2024
@SirEndii SirEndii added this to the 0.7.x milestone Apr 26, 2024
@zyxkad zyxkad self-assigned this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment