[solved] Where does the `creative` privilege come from and why can’t I set it? – Reason: API documentation is wrong

Post Reply
User avatar
Linuxdirk
Member
Posts: 3412
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

[solved] Where does the `creative` privilege come from and why can’t I set it? – Reason: API documentation is wrong

by Linuxdirk » Post

Heyo,

basically the title. I am currently toying a round with game development and I wonder how I can get the creative privilege working. I know that Luanti does not provide a creative menu where I can pick nodes from – I’ll create one, that’s not the issue.

But it seems like, there is no creative privilege at all. The API documentation says that it is a built-in privilege. But that’s not the case in Luanti 5.11.0?

I set this in my game.conf:

Code: Select all

disabled_settings = enable_damage, !creative_mode
According to the documentation this hides the checkboxes (what it does) and sets enable_damage to false (what it does, as expected) and enable creative_mode, which it seemingly does not.

I also don’t have creative-style gameplay, when I place a node it is removed from my inventory.

Even if I remove this game configuration and manually tick the checkbox I still don’t have a creative privilege or creative-like gameplay.

When I run /grantme all, I get those permissions:

ban, basic_privs, bring, debug, fast, fly, give, interact, kick, noclip, password, privs, protection_bypass, rollback, server, settime, shout, teleport

As you can see: no creative.

So, I wonder, how can I get the usual creative gameplay (i.e. nodes not removed from the inventory when placing them) … and why is there no creative privilege even if it should be a built-in one?

Thanks in advance for your help :)
Last edited by Linuxdirk on Tue Apr 15, 2025 14:03, edited 1 time in total.

User avatar
Desour
Member
Posts: 1581
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: Where does the `creative` privilege come from and why can’t I set it?

by Desour » Post

It comes from mtg's creative mod (see minetest.register_privilege call). Looks like our doc is wrong.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
TenPlus1
Member
Posts: 4364
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by TenPlus1 » Post

You have both creative mode which is global for all users, or 'creative' privelage which is granted to a few to allow them special build privelages. Mods can use the following command to tell if it is enabled or not:

if core.is_creative_enabled(name) then
-- do something creative
end

User avatar
Linuxdirk
Member
Posts: 3412
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by Linuxdirk » Post

Desour wrote:
Mon Apr 14, 2025 19:45
Looks like our doc is wrong.
It’s not “my doc”. It is the official Luanti API reference. 😃

TenPlus1 wrote:
Tue Apr 15, 2025 05:51
or 'creative' privelage
That is part of my point: I don’t have that.

There is no creative privilege even if the API documentation says it’s a built-in privilege.

User avatar
TenPlus1
Member
Posts: 4364
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by TenPlus1 » Post

@Linuxdirk - Are you running the default minetest_game ? it's definitely on creative mod in that if you do '/grantme all'
Last edited by TenPlus1 on Tue Apr 15, 2025 13:59, edited 1 time in total.

User avatar
Linuxdirk
Member
Posts: 3412
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by Linuxdirk » Post

TenPlus1 wrote:
Tue Apr 15, 2025 08:40
@Linuxdirk - Are you running the default minetest_game ?
No I don’t. It’s a basically blank game at the moment.

User avatar
LMD
Member
Posts: 1500
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by LMD » Post

As Desour said, the documentation is wrong. The creative privilege is indeed not registered in the engine (see builtin/game/privileges.lua for a correct list of engine privileges) but rather in MTG (see here).

The only engine feature is core.is_creative_enabled, the default implementation of which returns the (cached) value of creative_mode.
My stuff: Projects - Mods - Website

User avatar
Linuxdirk
Member
Posts: 3412
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by Linuxdirk » Post

Haha LOL … It just took me 2 hours of questioning my sanity while reading erroneous API documentation? So in case of “it is not working but it is documented” I can assume that the documentation is wrong? 😆

So Luanti actually does not know anything about creative mode except an otherwise technically meaningless flag being set that can be read by mods?

User avatar
Blockhead
Moderator
Posts: 2983
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by Blockhead » Post

Linuxdirk wrote:
Tue Apr 15, 2025 14:02
Haha LOL … It just took me 2 hours of questioning my sanity while reading erroneous API documentation? So in case of “it is not working but it is documented” I can assume that the documentation is wrong? 😆
Desour did say so:
Desour wrote:
Mon Apr 14, 2025 19:45
It comes from mtg's creative mod (see minetest.register_privilege call). Looks like our doc is wrong.
Bold text by me - not sure whether you misread or thought that it was a typo for "your".
Linuxdirk wrote:
Tue Apr 15, 2025 14:02
So Luanti actually does not know anything about creative mode except an otherwise technically meaningless flag being set that can be read by mods?
Yes indeed, you get to draw the rest of the owl.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Linuxdirk
Member
Posts: 3412
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Where does the `creative` privilege come from and why can’t I set it?

by Linuxdirk » Post

Blockhead wrote:
Tue Apr 15, 2025 14:44
Bold text by me - not sure whether you misread or thought that it was a typo for "your".
I guess I was tired 🙃
Blockhead wrote:
Tue Apr 15, 2025 14:44
Linuxdirk wrote:
Tue Apr 15, 2025 14:02
So Luanti actually does not know anything about creative mode except an otherwise technically meaningless flag being set that can be read by mods?
Yes indeed, you get to draw the rest of the owl.
Yeah, I can work with this. Was just was confused because the API reference is wrong.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests