What is the syntax to get an item to drop, 'cause I have a bomb that removes nodes and I want to know how to turn the nodes into items. Here's the code:
for x=-URANIUM_BOMB_RANGE,URANIUM_BOMB_RANGE do
for y=-URANIUM_BOMB_RANGE,URANIUM_BOMB_RANGE do
for z=-URANIUM_BOMB_RANGE,URANIUM_BOMB_RANGE do
if x*x+y*y+z*z <= URANIUM_BOMB_RANGE * URANIUM_BOMB_RANGE + URANIUM_BOMB_RANGE then
local np={x=pos.x+x,y=pos.y+y,z=pos.z+z}
local n = minetest.env:get_node(np)
if n.name ~= "air" then
-- I want to add the item drop here.
minetest.env:remove_node(np)
end
activate_if_tnt(n.name, np, pos, URANIUM_BOMB_RANGE)
end
end
end
end
Item Dropping
Item Dropping
</randomtextcrap>
</forumposthing>
</body>
</html>
/0
</forumposthing>
</body>
</html>
/0
-
- Member
- Posts: 570
- Joined: Fri Feb 17, 2012 21:55
- Location: Canada
Check the TNT mod by PilzAdam- it does have dropping code. /grin
We are what we create.
I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.
My github:
https://github.com/tinoesroho/
I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.
My github:
https://github.com/tinoesroho/
Who is online
Users browsing this forum: No registered users and 17 guests