turtle.attackDown

From ComputerCraft
Jump to: navigation, search

turtle.attackDown
Function
Syntax
turtle.attackDown()
Returns bool didAttack
API turtle
Source CC:Tweaked (source)

Attacks the entity under the turtle

  • The turtle can only attack when it has a tool and when a mob is in its range.
ExampleExampleCheck for hit
See if it was able to hit the entity it targeted
Code
local didHit = turtle.attack()
print(didHit)
Output
false