Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sense = peripheral.wrap("top")
- mobType = 0
- mobs = sense.getMobIds() -- find mobs
- while true do
- wither = false
- for k, mobId in pairs(mobs) do --read information stored in mobs
- mob = sense.getMobData(mobId)
- mobType = mob.type
- print("mob: "..mobType) --print mob type
- print("at X: "..mob.position.x) --print mob coordinates
- print("at Y: "..mob.position.y)
- print("at Z: "..mob.position.z)
- if mobType == "Wither" and mob.position.x < 4 and mob.position.z < 4 then
- wither = true
- print("Wither Spawned")
- while wither do
- rs.setOutput("left",true)
- os.sleep(0.1)
- rs.setOutput("left",false)
- mobs = sense.getMobIds()
- witherPersists = false
- for k, mobId in pairs(mobs) do
- mob = sense.getMobData(mobId)
- if mob.type == "Wither" then
- witherPersists = true
- end
- end
- if witherPersists == false then
- wither = false
- rs.setOutput("front", true)
- os.sleep(0.5)
- rs.setOutput("front", false)
- end
- end
- end
- end
- if wither == false then
- rs.setOutput("back", true)
- os.sleep(3)
- rs.setOutput("back", false)
- rs.setOutput("right", true)
- os.sleep(1.3)
- rs.setOutput("right", false)
- end
- os.sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement