Item Dropping

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

Item Dropping

by VoidLord » Fri Jul 05, 2013 23:30

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: 560
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Sat Jul 06, 2013 23:34

Check the TNT mod by PilzAdam- it does have dropping code. /grin
 


Return to Bugs and Problems

Who is online

Users browsing this forum: No registered users and 0 guests