Advertisement
Guest User

dragon

a guest
Oct 16th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. p = peripheral.wrap("back")
  2. local mobs
  3.  
  4. while true do
  5.   mobs = p.getEntityIds("mob")
  6.   if (table.getn(mobs) == 0) then
  7.   rs.setAnalogOutput("bottom", 0)
  8.   end
  9.  
  10.   for k,v in pairs(mobs) do    
  11.     local dragon = (p.getEntityData(v,"mob").basic().name)
  12.     print (dragon)
  13.     if (dragon) == "Ender Dragon" then
  14.     rs.setAnalogOutput("bottom", 15)
  15.     else
  16.     rs.setAnalogOutput("bottom", 0)
  17.     end
  18.   end
  19.   os.sleep(10)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement