turtle.attackUp

From ComputerCraft
Jump to navigation Jump to search

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

Attacks the entity over 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