mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add falling_block entity
This commit is contained in:
parent
277155e3d1
commit
f7d0ec438f
9 changed files with 115 additions and 8 deletions
14
res/content/base/scripts/sand.lua
Normal file
14
res/content/base/scripts/sand.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local function update(x, y, z)
|
||||
if block.is_replaceable_at(x, y-1, z) then
|
||||
entities.spawn("base:falling_block", {x+0.5, y+0.5, z+0.5}, {block='base:sand'})
|
||||
block.set(x, y, z, 0)
|
||||
end
|
||||
end
|
||||
|
||||
function on_update(x, y, z)
|
||||
update(x, y, z)
|
||||
end
|
||||
|
||||
function on_placed(x, y, z)
|
||||
update(x, y, z)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue