Post your modding questions here

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Mon May 13, 2013 20:29

I'm doing a mod (the Metal Light mod) and I want to implement a coal fueling feature.Basically, what I want is for the node which is the metallight:lighton to be replaced after 20 min with metallight:lightoff. I know how to do this, but, I was wondering, how do you make it restart by right-clicking it with coal, changing it back to a metallight:lighton and removing 1 coal from your inventory. This whole process needs to loop so so you can refuel it infinite times.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Tue May 14, 2013 16:27

Is there any way to make a block heal any player within a 20 block radius? The block name is 'decoblock:eyestone_active'.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Tue May 14, 2013 16:45

Dan Duncombe wrote:Is there any way to make a block heal any player within a 20 block radius? The block name is 'decoblock:eyestone_active'.


Yes, it is. Use
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
get_objects_inside_radius(pos, radius)
(http://dev.minetest.net/EnvRef)

and
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
set_hp(hp)
(http://dev.minetest.net/Player)
 

User avatar
Aqua
Member
 
Posts: 641
Joined: Wed Aug 22, 2012 09:11

by Aqua » Wed May 15, 2013 12:25

Is it possible to make a player jump higher currently?
Hi there ^.~
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Wed May 15, 2013 12:33

Aqua wrote:Is it possible to make a player jump higher currently?

I think so with the new api for the player physics override, but Idk how to do it.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed May 15, 2013 12:52

Evergreen wrote:
Aqua wrote:Is it possible to make a player jump higher currently?

I think so with the new api for the player physics override, but Idk how to do it.

Its trivial with set_physics_override().
 

1244
Member
 
Posts: 45
Joined: Fri Jul 13, 2012 16:40

by 1244 » Thu May 16, 2013 14:33

I have problem with rightclick event in register node. This function working ok if I don't hold shift("sneak"). When I hold shift function isn't working. Why?
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Thu May 16, 2013 14:37

1244 wrote:I have problem with rightclick event in register node. This function working ok if I don't hold shift("sneak"). When I hold shift function isn't working. Why?

Can you post the code?
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu May 16, 2013 14:45

1244 wrote:I have problem with rightclick event in register node. This function working ok if I don't hold shift("sneak"). When I hold shift function isn't working. Why?

Not calling on_rightclick() when holding shift is a feature. This way you can place nodes when pointing at chests etc.
Last edited by PilzAdam on Thu May 16, 2013 14:45, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Wed May 22, 2013 14:53

Is it possible to make torches only be placed on sale and ground by leaving out the ceiling node box?
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Wed May 22, 2013 19:56

I know this doesn't have to do with mods, but how large is a chunk(otherwise known as block)? And how can I tell that I am on the edge of a chunk?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Wed May 22, 2013 22:27

For the first question it is 16*16*16
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed May 22, 2013 22:45

Evergreen wrote:I know this doesn't have to do with mods, but how large is a chunk(otherwise known as block)? And how can I tell that I am on the edge of a chunk?

16³

for the second question, it's just easy math:

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
local pos = player:getpos()
local relpos = { x=pos.x % 16, y=pos.y % 16, z=pos.z % 16 }
if relpos.x <= 1 or relpos.x >= 15 or relpos.y <= 1 or relpos.y >= 15 or relpos.z <= 1 or relpos.z >= 15 then
  -- I am at the edge
else
  -- I am not
end

EDIT: Adjust values as necessary.
Last edited by kaeza on Wed May 22, 2013 22:47, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed May 22, 2013 22:47

Evergreen wrote:I know this doesn't have to do with mods, but how large is a chunk(otherwise known as block)? And how can I tell that I am on the edge of a chunk?

As jojoa said, a mapblock is 16x16x16 nodes. However, the map generator always generates 5x5x5 mapblocks at once.

To see if you are at the edge of the mapblock just look at the animation of lava. It is by default not synced (there is a setting for that in minetest.conf), so you can see the mapblock borders.

EDIT: 2500 POSTS!!!!
Last edited by PilzAdam on Wed May 22, 2013 22:49, edited 1 time in total.
 

shaneroach
Member
 
Posts: 141
Joined: Sat Apr 20, 2013 21:05

by shaneroach » Thu May 23, 2013 04:35

PilzAdam wrote:EDIT: 2500 POSTS!!!!


LOL

Somehow you didn't strike me as someone who would get excited about your post totals.

Good jorb, Adam. Good jorb.
In order to change yourself, you must believe the change is possible and that there are rewards for making the change.
- Inspired by Hebrews 11:6
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Thu May 23, 2013 09:49

PilzAdam wrote:
Evergreen wrote:I know this doesn't have to do with mods, but how large is a chunk(otherwise known as block)? And how can I tell that I am on the edge of a chunk?

As jojoa said, a mapblock is 16x16x16 nodes. However, the map generator always generates 5x5x5 mapblocks at once.

To see if you are at the edge of the mapblock just look at the animation of lava. It is by default not synced (there is a setting for that in minetest.conf), so you can see the mapblock borders.

EDIT: 2500 POSTS!!!!
why do mapblocks generate 5*5*5 and not 16*16*16
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Thu May 23, 2013 10:02

jojoa1997 wrote:why do mapblocks generate 5*5*5 and not 16*16*16

DERP
Last edited by kaeza on Thu May 23, 2013 10:02, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 14:57

Here is something I was working on. What I want is a cauldron that fills with water when right clicked with a bucket of water. I tried this but it doesn't work. Here is the code:
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
minetest.register_node("thaumtest:cauldron_full",{
    drawtype="nodebox",
    paramtype = "light",
    tiles = {"default_wood.png"},
    groups = {choppy=2},
    node_box = {
        type = "fixed",
        fixed = {
            {-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
            {0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
            {-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
            {-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.312500,-0.500000,0.500000,0.312500,0.500000},
            {-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
            {0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
            {0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
        }
    }
})

minetest.register_node("thaumtest:cauldron_empty",{
    drawtype="nodebox",
    description= "Cauldron",
    paramtype = "light",
    tiles = {"default_wood.png"},
    groups = {choppy=2},
    node_box = {
        type = "fixed",
        fixed = {
            {-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
            {0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
            {-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
            {-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
            {0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
            {0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
            {-0.500000,-0.375000,-0.500000,0.500000,-0.312500,0.500000},
        }
    }
    on_rightclick = function(pos, node, clicker, itemstack)
            if itemstack:get_name() == "bucket:bucket_water" then
                  minetest.env:set_node(pos, "thaumtest:cauldron_full")
            end
    end
    }
})
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Sat May 25, 2013 15:02

I thougt it would be nice if you could change stack_max using a setting. So game-modes could use minetest.config instead of overwriting.

This is my first try, but it is not working at all:
in builtin/item.lua line 376
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
--
-- Item definition defaults
--
local stack_max = 99
if tonumber(minetest.setting_get(stack_max)) then
    stack_max = tonumber(minetest.setting_get(stack_max))
    print("[builtin] stack_max = ".. tonumber(minetest.setting_get(stack_max)) .."")
end

minetest.nodedef_default = {
    -- Item properties
    type="node",
    -- name intentionally not defined here
    description = "",
    groups = {},
    inventory_image = "",
    wield_image = "",
    wield_scale = {x=1,y=1,z=1},
    stack_max = stack_max,
-- . . .


@Evergreen
You need to add a , at the end of the on_rightclick and the nodebox.
Last edited by Casimir on Sat May 25, 2013 15:04, edited 1 time in total.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 15:14

Tried it and it still doesn't work. Code:
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
minetest.register_node("thaumtest:cauldron_full",{
    drawtype="nodebox",
    paramtype = "light",
    tiles = {"default_wood.png"},
    groups = {choppy=2},
    node_box = {
        type = "fixed",
        fixed = {
            {-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
            {0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
            {-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
            {-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.312500,-0.500000,0.500000,0.312500,0.500000},
            {-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
            {0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
            {0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
        }
    }
})

minetest.register_node("thaumtest:cauldron_empty",{
    drawtype="nodebox",
    description= "Cauldron",
    paramtype = "light",
    tiles = {"default_wood.png"},
    groups = {choppy=2},
    node_box = {
        type = "fixed",
        fixed = {
            {-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
            {0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
            {-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
            {-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
            {0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
            {0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
            {-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
            {-0.500000,-0.375000,-0.500000,0.500000,-0.312500,0.500000},
        }
    },
    on_rightclick = function(pos, node, clicker, itemstack)
            if itemstack:get_name() == "bucket:bucket_water" then
                  minetest.env:set_node(pos, "thaumtest:cauldron_full")
            end
    end,
    }
})
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sat May 25, 2013 15:30

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
  (...)
  on_rightclick = function(pos, node, clicker, itemstack)
    if itemstack:get_name() == "bucket:bucket_water" then
      minetest.env:set_node(pos, "thaumtest:cauldron_full")
    end
  end,
  } <-- REMOVE THIS
})
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat May 25, 2013 15:49

Evergreen wrote:Tried it and it still doesn't work. Code:
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
-code-


It is caused by the bucket mod. -> https://github.com/minetest/minetest_game/blob/master/mods/bucket/init.lua#L42

When it is changed to on_use() [in bucket mod] it works fine.
^
Edit: Casimirs solution is better (to use on_punch()).

And it has to be
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
  minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
Last edited by BlockMen on Sat May 25, 2013 15:59, edited 1 time in total.
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Sat May 25, 2013 15:52

Now working:
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
local stack_max = 99
if minetest.setting_get("stack_max") then
    stack_max = minetest.setting_get("stack_max")
end

Please interpret this as a pullrequest ;)

@Evergreen
You will encounter an additional problem. The bucket is not calling the on_rightclick function of nodes, it will just place the water. You could use on_punch.
Edit: BlockMen was faster
Last edited by Casimir on Sat May 25, 2013 15:53, edited 1 time in total.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 16:08

kaeza wrote:
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
  (...)
  on_rightclick = function(pos, node, clicker, itemstack)
    if itemstack:get_name() == "bucket:bucket_water" then
      minetest.env:set_node(pos, "thaumtest:cauldron_full")
    end
  end,
  } <-- REMOVE THIS
})

I looked in the debug, and that is supposed to be there. EDIT: nvm
Last edited by Evergreen on Sat May 25, 2013 16:12, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 16:11

BlockMen wrote:
Evergreen wrote:Tried it and it still doesn't work. Code:
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
-code-


It is caused by the bucket mod. -> https://github.com/minetest/minetest_game/blob/master/mods/bucket/init.lua#L42

When it is changed to on_use() [in bucket mod] it works fine.
^
Edit: Casimirs solution is better (to use on_punch()).

And it has to be
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
  minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})

Soon it will not be minetest.env:set_node it will be minetest.set_node. Just something to think about.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 16:15

Getting closer, but now I get an error when punching the cauldron with the bucket.
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
12:13:01: ERROR[main]: ServerError: LuaError: error: ...rett/Desktop/Minetest/bin/../mods/thaumtest/init.lua:43: attempt to index local 'itemstack' (a nil value)
12:13:01: ERROR[main]: stack traceback:
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat May 25, 2013 16:21

Evergreen wrote:Getting closer, but now I get an error when punching the cauldron with the bucket.
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
12:13:01: ERROR[main]: ServerError: LuaError: error: ...rett/Desktop/Minetest/bin/../mods/thaumtest/init.lua:43: attempt to index local 'itemstack' (a nil value)
12:13:01: ERROR[main]: stack traceback:


Of cause you get this error, because on_punch gives no itemstack -> https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L1737

you have to change it to this
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
   on_punch = function(pos, node, puncher)
    if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then
     minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
    end
  end,
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 16:48

Thanks, it works now. The next problem is to empty the bucket when the cauldron is punched. (don't answer this until I have a problem)
Last edited by Evergreen on Sat May 25, 2013 17:00, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 17:05

I have a problem. I tried to do this:
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
on_punch = function(pos, node, puncher)
        if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then
            minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
            minetest.env:replace({item="bucket:bucket_empty"})
        end
end,
Last edited by Evergreen on Sat May 25, 2013 17:05, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sat May 25, 2013 17:13

BlockMen wrote:
Evergreen wrote:Getting closer, but now I get an error when punching the cauldron with the bucket.
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
12:13:01: ERROR[main]: ServerError: LuaError: error: ...rett/Desktop/Minetest/bin/../mods/thaumtest/init.lua:43: attempt to index local 'itemstack' (a nil value)
12:13:01: ERROR[main]: stack traceback:


Of cause you get this error, because on_punch gives no itemstack -> https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L1737

you have to change it to this
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
   on_punch = function(pos, node, puncher)
    if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then
     minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
    end
  end,

he was using on_rightclick, not on_punch.
Evergreen wrote:minetest.env:replace({item="bucket:bucket_empty"})

wat

Edit:
just do:
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
local inv = puncher:get_inventory()
inv:remove_item("main", itemstack)
itemstack = ItemStack("bucket:bucket_empty")
inv:add_item("main", itemstack)
player:set_wielded_item(itemstack)


Edit 2:
Scratch that, I missed the earlier post about the bucket mod not calling on_rightclick.
Last edited by kaeza on Sat May 25, 2013 17:19, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 48 guests

cron