turtle.attackDown

turtle.attackDown
Function
Syntax
turtle.attackDown(
  • toolSide? : string
)

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.
ExampleCheck for hit
See if it was able to hit the entity it targeted
Code
<nowiki>
local didHit = turtle.attack()
print(didHit)
    </nowiki>
Output
false
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.