@ScriptCallable( returnTypes = {ReturnType.NUMBER, ReturnType.NUMBER, ReturnType.NUMBER}, description = "Get turtle position") public IMultiReturn getPosition() { EntityMagnet magnet = getMagnet(); Vec3 rotated = getRelativeDistance(magnet); return MultiReturn.wrap(rotated.xCoord, rotated.yCoord, rotated.zCoord); }
@Alias("distance") @ScriptCallable(returnTypes = {ReturnType.NUMBER, ReturnType.NUMBER, ReturnType.NUMBER}) public IMultiReturn getDistanceToTarget() { EntityMagnet magnet = getMagnet(); Vec3 current = getRelativeDistance(magnet); Vec3 target = magnetOwner.target; return MultiReturn.wrap( current.xCoord - target.xCoord, current.yCoord - target.yCoord, current.zCoord - target.zCoord); }