Go to file
Darcidride 527ccab629
Merge pull request #2 from Panquesito7/master
Improve "README.md" and add "mod.conf"
2019-08-23 13:32:55 +00:00
LICENSE Initial commit 2017-04-06 21:08:44 +02:00
README.md Update README.md 2019-08-22 19:57:43 -05:00
init.lua first commit 2017-04-06 21:15:59 +02:00
mod.conf Create mod.conf 2019-08-22 19:56:41 -05:00

README.md

Player Physics

A minetest mod to centralize the management of player's stats(sprint, jump, gravity) Because many mods (sprint, 3d_armor and others) rewrite the stats in their corner and it cancel

API

  • player_physics.set_stats(player, "uniq_name", table)

  • layer_physics.remove_stats(player, "uniq_name")

API examples

  • player_physics.set_stats(player, "potion_speedlvl1", {speed=0.35})

  • player_physics.set_stats(player, "sprint_mod", {speed=0.35, jump=0.1})

  • player_physics.remove_stats(player, "potion_speedlvl1")

Temporary effect

  • player_physics.add_effect(player, "uniq_name", time, stats)
  • player_physics.remove_effect(player, "uniq_name")

Code example

You make a potion that adds speed for 10 seconds.

on_use = function(itemstack, user, pointed_thing)
   player_physics.add_effect(user, "potion_speedlvl1", 10, {speed=0.6})
   itemstack:take_item()
   return itemstack
end