Is there a way to make a craftable item limited to a specific player.
For example in the recipe for coding a item add this
if player = playername or group
then item is registered and craftable by that player.
else
other players dont see the item.
but also if the "playername or group" can be pulled from a name file on the server that can be edited.
Player Specific Inventory Crafter.
-
- Member
- Posts: 265
- Joined: Sat Jul 25, 2015 19:54
- In-game: DoyleChris
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Player Specific Inventory Crafter.
Not directly. The easiest way might be to add a "machine" that works like a crafting table and honors your restrictions.
A list of my mods can be found here.
Re: Player Specific Inventory Crafter.
DoyleChris wrote:Is there a way to make a craftable item limited to a specific player.
For example in the recipe for coding a item add this
if player = playername or group
then item is registered and craftable by that player.
else
other players dont see the item.
but also if the "playername or group" can be pulled from a name file on the server that can be edited.
Sounds to me like a candidate for a feature request,
such as adding a member named: "visible_to".
if visible_to == nil or visible_to == "" then
-- visible to all
else
-- visible only to named players or groups
end
https://dev.minetest.net/minetest.register_craft
eg:
Code: Select all
minetest.register_craft({
type = "shapeless",
output = "wool:green",
recipe = {"group:wool", "dye:green"},
replacements = {
{"dye:green", "test:testnode"}
}
visible_to = { "name1", "group:group_name", "name2" }
})
and then use the read data to construct a list of names and/or groups to pass to "visible_to"
You can submit a new isssue/feature request here:
A suggest for the title would be:
Code: Select all
[Feature request] Add named players and groups to craft recipes
===========================
Otherwise you can do what Sokomine suggested,
If you were to inject (ie define your craft recipe) to include visible_to then a custom craft table (machine, etc)Sokomine wrote: Not directly. The easiest way might be to add a "machine" that works like a crafting table and honors your restrictions.
could use this new feature to limit available crafting recipes to only the defined players -- but it would not limit visibility in the vanilla crafting system (ie in-inventory, etc).
You could workaround that limitation by removing all crafting methods (including in-inventory) such that the players cannot craft unless they use your added crafting table.
Re: Player Specific Inventory Crafter.
Using this you can do it i think
Code: Select all
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv))
Re: Player Specific Inventory Crafter.
It is possible with this mod https://github.com/rubenwardy/crafting but it may not be exactly what you are looking for as it is an overhaul of the crafting system where basically all recipes became shapeless.
I am currently using it in conjunction with something I called "skill books" to acquire new recipes.
I am currently using it in conjunction with something I called "skill books" to acquire new recipes.
-
- Member
- Posts: 162
- Joined: Wed Nov 09, 2016 16:43
- GitHub: akryukov92
- In-game: Xudo
Re: Player Specific Inventory Crafter.
I think that craft recipe should be assigned to some kind of "grid". So modders could give access to grid in different kind of ui.
For example modders could add multiple different drafting tables with different recipes.
For example modders could add multiple different drafting tables with different recipes.
Who is online
Users browsing this forum: No registered users and 1 guest