Difference between revisions of "Turtle.attack"

From ComputerCraft Wiki
Jump to: navigation, search
Line 8: Line 8:
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|desc=Attempts to attack the block in front.
 
|desc=Attempts to attack the block in front.
−
|examples=
 
−
{{Example
 
−
|desc=Tries to attack a mob/player in front and outputs whether it worked or not.
 
−
|code=if turtle.attack() then
 
−
  [[print]] ("Turtle attacked in Front.")
 
−
else
 
−
  [[print]] ("Turtle Could not attack.")
 
−
end
 
−
|output= Turtle attacked in Front. or Turtle Could not attack.
 
−
}}
 

Revision as of 12:31, 24 September 2012

This page is a stub.
Please help us by expanding it.

This page is currently unfinished.


{{Function |name=turtle.attack |api=turtle |returns=boolean whether the turtle succeeded in attacking |addon=ComputerCraft |desc=Attempts to attack the block in front.