Item Dropping

Post Reply
User avatar
VoidLord
Member
Posts: 46
Joined: Sun Jan 20, 2013 16:07
Location: SPACE! WHAT!?

Item Dropping

by VoidLord » Post

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
</randomtextcrap>
</forumposthing>
</body>
</html>
/0

tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

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/

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests