function _locationToJSON(location) {
  var yaw = __plugin.bukkit
    ? location.yaw
    : __plugin.canary ? location.rotation : 0;
  return {
    world: '' + location.world.name,
    x: location.x,
    y: location.y,
    z: location.z,
    yaw: yaw,
    pitch: location.pitch
  };
}
**********************************************************************
### utils.locationToJSON() function

utils.locationToJSON() returns a [Location][cmloc] object in JSON form...

    { world: 'world5',
      x: 56.9324,
      y: 103.9954,
      z: 43.1323,
      yaw: 0.0,
      pitch: 0.0
    }

This can be useful if you write a plugin that needs to store location data since bukkit's Location object is a Java object which cannot be serialized to JSON by default.

#### Parameters
location: An object of type [Location][cmloc]

#### Returns

A JSON object in the above form.
*