MCPcopy Index your code
hub / github.com/walterhiggins/ScriptCraft / getPlayerPos

Function getPlayerPos

src/main/js/modules/utils/utils.js:251–267  ·  view source on GitHub ↗

### utils.getPlayerPos() function This function returns the player's [Location][cmloc] (x, y, z, pitch and yaw) for a named player. If the "player" is in fact a [BlockCommand][bkbcs] then the attached Block's location is returned. #### Parameters * player : A [org.bukkit.command.CommandSender][

(player)

Source from the content-addressed store, hash-verified

249[bksndr]: http://jd.bukkit.org/dev/apidocs/index.html?org/bukkit/command/CommandSender.html
250***/
251function getPlayerPos(player) {
252 player = _player(player);
253 if (player) {
254 if (__plugin.bukkit) {
255 if (player instanceof bkBlockCommandSender) return player.block.location;
256 else return player.location;
257 }
258 if (__plugin.canary) {
259 if (
260 player instanceof Packages.net.canarymod.api.world.blocks.CommandBlock
261 )
262 return player.block.location;
263 else return player.location;
264 }
265 }
266 return null;
267}
268exports.getPlayerPos = getPlayerPos;
269/************************************************************************
270### utils.getMousePos() function

Callers

nothing calls this directly

Calls 1

_playerFunction · 0.85

Tested by

no test coverage detected