Player¶
Change properties of a single player, like there view, speed or gravity.
-
class
miney.
Player
(minetest: miney.minetest.Minetest, name)[source]¶ A player of the minetest server.
-
property
fast
¶ Get and set the privilege for fast mode to this player. Press J to enable and disable fast mode.
- Returns
-
property
fly
¶ Get and set the privilege to fly to this player. Press K to enable and disable fly mode.
- Returns
-
property
gravity
¶ Get or set the players gravity. Default is 1.
- Returns
Float
-
property
hp
¶ Get and set the number of hitpoints (2 * number of hearts) between 0 and 20. By setting his hitpoint to zero you instantly kill this player.
- Returns
-
inventory
: miney.Inventory¶ Manipulate player’s inventory.
- Example to add 99 dirt to player “IloveDirt“‘s inventory
>>> import miney >>> mt = miney.Minetest() >>> mt.player.IloveDirt.inventory.add(mt.node.type.default.dirt, 99)
- Example to remove 99 dirt from player “IhateDirt“‘s inventory
>>> import miney >>> mt = miney.Minetest() >>> mt.player.IhateDirt.inventory.remove(mt.node.type.default.dirt, 99)
-
property
is_online
¶ Returns the online status of this player.
- Returns
True or False
-
property
jump
¶ Get or set the players jump height. Default is 1.
- Returns
Float
-
property
look
¶ Get and set look in radians. Horizontal angle is counter-clockwise from the +z direction. Vertical angle ranges between -pi/2 (~-1.563) and pi/2 (~1.563), which are straight up and down respectively.
- Returns
A dict like {‘v’: 0.34, ‘h’: 2.50} where h is horizontal and v = vertical
-
property
look_horizontal
¶ Get and set yaw in radians. Angle is counter-clockwise from the +z direction.
- Returns
Pitch in radians
-
property
look_vertical
¶ Get and set pitch in radians. Angle ranges between -pi/2 (~-1.563) and pi/2 (~1.563), which are straight up and down respectively.
- Returns
Pitch in radians
-
property
noclip
¶ Get and set the privilege for noclip mode to this player. Press H to enable and disable noclip mode.
- Returns
-
property
position
¶ Get or set the players current position.
To place a player on top of a specific node, add 0.5 to the y value and his feet will touch this node. A player needs two blocks in the y axis (he’s around 1,5 node tall), or he is stuck.
- Returns
-
property
speed
¶ Get or set the players speed. Default is 1.
- Returns
Float
-
property