turtle.attack
From ComputerCraft
Jump to navigation
Jump to search
turtle.attack Function | |
---|---|
Syntax turtle.attack(
| |
Returns | bool didAttack |
API | turtle |
Source | CC:Tweaked (source) |
Attacks the entity in direction and range
The turtle can only attack when it has a tool and when a mob is in its range.
|
|||
See if it was able to hit the entity it targeted | |||
Code | local didHit = turtle.attack()
print(didHit)
|
||
Output | false
1
|