This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Azami1990's profile picture

Count how many mobs are in Range (OpenPeripheral Sensor)

Started by Azami1990, 09 May 2017 - 08:33 PM
Azami1990 #1
Posted 09 May 2017 - 10:33 PM
Hey!

I'm trying to make a simple Script to emit a Redstone Signal when x Mobs (Witches) are near the Computer.

I stumbled over this Post (http://www.computercraft.info/forums2/index.php?/topic/22816-openperipheral-counting-child-mobs-with-the-sensor/) and tried to rewrite it. Beside that getMobIds() and getMobData() are depricatet i cant find a way to count specific Mob Types (Witch).

Normaly when i write a Script/Programm i print everything and use Google and my Brain but i stuck at the Output from getEntityData(id, "mob") cause its all functions and i dont know how to get on the data behind these.

I dont know its the time (11:35 pm in Germany) or if i'm to dump to find a way…^^

Could someone enlighten me, maybe with a script to count a single Mobs Type?

Thanks
Merlin
KingofGamesYami #2
Posted 10 May 2017 - 01:55 AM
It sounds like you use a process close to what I've outlined here.

At the very minimum I would like to request you post the output of using that process. From that, I should be able to figure out a solution for you :)/>
Azami1990 #3
Posted 10 May 2017 - 03:09 PM
Hey!

I use opdoc for better reading and google for some codesnipets but yes, thats my process in coding.

Here is my Code: https://drive.google.com/open?id=0B2Ksp5IVXgmNdDdHTmExX3BOalU
And the Output: https://drive.google.com/open?id=0B2Ksp5IVXgmNTEk1Q1I2SGQ0NkE

(The Forum wont let me Attach anything :/ )

Thanks for your Help!