Advertisement
thatparadox

findMobs

Dec 14th, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. --http://www.youtube.com/watch?v=Eq27GOX71TU
  2. bot = 1 --assign OpenMech id
  3. mech = peripheral.wrap("right") --attach Robot Controller
  4.  
  5. mobs = mech.getMobIds(bot) -- find mobs
  6.  
  7. for k, mobId in pairs(mobs) do --read information stored in mobs
  8.   mob = mech.getMobData(bot, mobId)
  9.   mobType = mob.type
  10.   print("mob: "..mobType) --print mob type
  11.   print("at X: "..mob.position.x) --print mob coordinates
  12.   print("at Y: "..mob.position.y)
  13.   print("at Z: "..mob.position.z)  
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement