Advanced Peripherals

Advanced Peripherals

29M Downloads

Environment Detector on turtle bug

Kevin125566 opened this issue ยท 1 comments

commented

Describe

Calling environmentDetector.scanEntities(5) on a turtle returns nil the second time

Steps to reproduce

  1. Place a turtle with an environment detector in it down
  2. Call the scanEntities(range) method twice
  3. Second return value is nil

Multiplayer?

Yes

Version

1.20.1-0.7.40r (Latest 1.20.1)

Minecraft, Forge and maybe other related mods versions

Forge 47.3.0 Minecraft 1.20.1

Screenshots or Videos

Screenshot 2024-08-29 060703 Screenshot 2024-08-29 060831

Crashlog/log

No response

commented

This is because scan and other operations have cooldown.
If you do

entities, err = detector.scanEntities(5)
if not entities then
  printError(err)
end

It will show you the error.

You also can check the cooldown by invoking getOperationCooldown