add drop.json

This commit is contained in:
MihailRis
2024-06-27 03:09:16 +03:00
parent 8d41f6af11
commit 20ab48ecab
8 changed files with 28 additions and 13 deletions
+5 -2
View File
@@ -1,6 +1,6 @@
{
"items": [
"bazalt_breaker"
"entities": [
"drop"
],
"blocks": [
"dirt",
@@ -27,5 +27,8 @@
"lightbulb",
"torch",
"wooden_door"
],
"items": [
"bazalt_breaker"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"hitbox": [0.2, 0.2, 0.2]
}
+1 -1
View File
@@ -5,7 +5,7 @@ function on_hud_open()
input.add_callback("player.drop", function ()
local pid = hud.get_player()
local pvel = {player.get_vel(pid)}
local eid = entity.test()
local eid = entity.spawn("base:drop")
local throw_force = vec3.mul(player.get_dir(pid), DROP_FORCE)
entity.set_vel(eid, vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL)))
end)