ON THIS WIKI
Magnet Turtle
Magnet Turtle | |
---|---|
| |
Name | Magnet Turtle |
Source Mod | OpenBlocks |
ID Name | Unknown |
Type | Block |
Stackable | Yes (64) |
Solid | Yes |
Transparent | No |
Affected by Gravity | No |
Emits Light | No |
Flammable | No |
Required Tool |
The Magnet Turtle is a block added by the OpenBlocks mod. A Turtle with the added capability of a Crane Backpack, you can program it to pick up, carry, and place blocks.
Similar to the standard Turtle, there are multiple variants that allow for added capabilities, such as the Advanced Turtle which adds a color terminal, and a Mining/Felling/Digging/Melee version. See the Turtle page for more information; using a Magnet Turtle in place of a Turtle for most Turtle recipes will create its related variant.
Recipe[edit]
Usage[edit]
Like the Wireless Modem, the Miracle Magnet attached to the Turtle must be referenced using peripheral.wrap(side) or peripheral.call("side", method), where side will either refer to either its left or its right, depending on the side of the Turtle that the magnet is on.
Like other Turtles, it can use the standard Turtle (API) as well as any additional APIs provided by equipped items.
Magnet (API)[edit]
Note: This is assuming that magnet references the Miracle Magnet attached to the turtle, using local magnet = peripheral.wrap(side), or else you will need to call these using the peripheral.call() function sans the "magnet." prefix.
Method name | Alias | Description | Reasons for failure | Return type/data |
---|---|---|---|---|
magnet.activate() | Causes the magnet to appear alongside the Turtle. | No fuel; Block in the way of deployment ("Can't deploy magnet"); Magnet already active | ||
magnet.deactivate() | Removes an activated magnet. | No fuel; Magnet not active; Magnet too far | ||
magnet.getDistanceToTarget() | magnet.distance() | Returns the total distance from the magnet's current position to its target position in the form of an x, y, and z value. | Magnet not active | int x, int y, int z |
magnet.getPosition() | Returns current position of magnet in the form of an x, y, and z value. | Magnet not active | int x, int y, int z | |
magnet.isAboveEntity() | Returns status of whether or not the magnet is currently above an Entity. Note that the magnet must be directly above the entity with no distance between itself and the Entity. | Magnet not active | bool | |
magnet.isGrabbing() | Returns status of whether the magnet currently is grabbing something. | Magnet not active | bool | |
magnet.setTarget(int x, int y, int z) | Sets desired position of magnet, which will then attempt to move to the set position. 32 is the maximum value, or range, for any given coordinate. | No fuel; Magnet not active; Target out of range | ||
magnet.toggleMagnet() | magnet.toggle() | Picks up a block beneath the magnet, or places the block the magnet is currently grabbing. Returns a Boolean value indicating whether or not the operation was successfully carried out (returns false when a block was neither able to be placed or picked up). | bool |
Most, if not all of these functions will throw exceptions that may be tricky to handle. It is best to prevent this by making sure that:
- The turtle has fuel
- Nothing is in the way of the magnet's deployment
- The magnet is activated before attempting its related functions
- The program does not attempt to set the magnet's target outside of its accepted range (+/-32 blocks for any coordinate)
- The magnet is not deactivated until it is returned to a position near the turtle (for example, use magnet.setTarget(0,0,0) beforehand)
|
Twitter Feed
Warning: file_get_contents(/srv/common/): failed to open stream: No such file or directory in /var/www/html/skins/MMWiki/SkinMMWiki.php on line 392