[Solved] How do you check when an item is dropped?

lkjoel
Member
 
Posts: 778
Joined: Wed Feb 29, 2012 19:27

[Solved] How do you check when an item is dropped?

by lkjoel » Wed Apr 11, 2012 21:04

I'm making a mod with jordan4ibanez, and I need help to check when an item is dropped. This means dropped and on the ground, not dropping. This is crucial.
Any ideas on how to implement this?
Last edited by lkjoel on Wed Apr 11, 2012 21:42, edited 1 time in total.
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Wed Apr 11, 2012 21:07

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
        if minetest.registered_nodes[nn].walkable then
            if self.physical_state then
                self.object:setvelocity({x=0,y=0,z=0})
                self.object:setacceleration({x=0, y=0, z=0})
                self.physical_state = false
                self.object:set_properties({
                    physical = false
                })
            end
        else

This is in builtin/item_entity.lua
I suppose everything in this if clause is executed if an item is on the ground. What do you want to do?
If you want to make the item kinda "fly" to you when walking next to it, I already tried it. I can give you some advice.
Last edited by Jeija on Wed Apr 11, 2012 21:08, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

lkjoel
Member
 
Posts: 778
Joined: Wed Feb 29, 2012 19:27

by lkjoel » Wed Apr 11, 2012 21:14

yeah, like in minecraft. We have an outer circle that makes the item fly to you, and an inner circle that adds it to your inventory.
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
 

lkjoel
Member
 
Posts: 778
Joined: Wed Feb 29, 2012 19:27

by lkjoel » Wed Apr 11, 2012 21:42

thanks a lot! It works
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests