Hello!
I'm creating a mod for minetest 0.4.16 and I'm trying to create gui which will be showed to player after right clicking block.
I want the gui to contain slot in which we can put item and in other slot other item will be added.
Sorry for my english but it isn't my native language.
Showing gui to player after right clicking on block
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Showing gui to player after right clicking on block
A bit late, but I figured an answer would be nice for future's sake.
Useful guide to formspecs here.
Note that the links to the API I used were for 0.4.17.1, while the modding book contains content pertaining to version >=5.0.0.
If you insist on using 0.4.x, I would suggest upgrading to 0.4.17.1. Otherwise, you may want to upgrade to 5.1.0 -- lots of new fun API features have been added!mrkubax10 wrote:I'm creating a mod for minetest 0.4.16
Assuming you know how to make a formspec (gui), you can show it to the player via on_rightclick in the node definition of the block you wish to show it from. Something akin toI'm trying to create gui which will be showed to player after right clicking block.
Code: Select all
on_rightclick = function(pos, node, clicker)
minetest.show_formspec(clicker:get_player_name(), "my_awesome_form", "label[0,0,This is a formspec!]")
end,
This will require a node metadata inventory and for your formspec to be a node meta formspec.I want the gui to contain slot in which we can put item and in other slot other item will be added.
Note that the links to the API I used were for 0.4.17.1, while the modding book contains content pertaining to version >=5.0.0.
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
Who is online
Users browsing this forum: SkyBuilder1717 and 8 guests