i found a function in the technic-modpack, but that does not work in my mod:
- Code: Select all
technic.register_grinder_recipe({ input, output })
technic.register_grinder_recipe({ input, output })
RHR wrote:Is there any way to create light-emitting entities?
rubberduck wrote:is there a way to add a recipe for the technic grinder in my mod????, something like using type = "grinding", or do i have to add something in the technic modpack???
i found a function in the technic-modpack, but that does not work in my mod: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
technic.register_grinder_recipe({ input, output })
local function getValid(value, default)
v = minetest.setting_get(value)
return (v == nil and default or v)
end
local player_name = player:get_player_name()
minetest.chat_send_player(player_name, 'hello')
tfranko wrote:How do I get the name of the player running a command? I'm registering a chat command that needs to use the name of the player that's running that command.
<snip>
function name_of_my_function(name)
...
minetest.chat_send_player(name, 'hello')
end
minetest.register_chatcommand("foo", {
description = "bar",
params = "",
func = function(name, params)
minetest.chat_send_player(name, "Hello, "..name.."!")
end,
})
kaeza wrote:That's probably because `player` is nil at that point in the script, and you are calling the method `get_player_name` on a nil value (in simple terms, you are trying to get the player name of nothing at all).
<snip>
Achilles wrote:When an admin requests a server shutdown on a server, how long will the server shutdown for? or How do you get it back up?
Sorry I've never tried this before and I don't want to mess it up...
Krock wrote:Achilles wrote:When an admin requests a server shutdown on a server, how long will the server shutdown for? or How do you get it back up?
Sorry I've never tried this before and I don't want to mess it up...
It will be down as long nothing restarts the minetest server.
Xenon wrote:Is there a way to register multiblock structures?
Also, is there a way to add different dimensions?
If so, I would love to know!
Esteban wrote:Xenon wrote:Is there a way to register multiblock structures?
Also, is there a way to add different dimensions?
If so, I would love to know!
Do you mean like buildings? If so, this might be helpful: [Mod] Generative architecture [0.1.7] [projects]
Xenon wrote:Is there a way to register multiblock structures?
Also, is there a way to add different dimensions?
If so, I would love to know!
Hybrid Dog wrote:Xenon wrote:Is there a way to register multiblock structures?
Also, is there a way to add different dimensions?
If so, I would love to know!
Of course, there are lots of ways to register structures with more blocks, you just need to find out the definition for these structures and then put it into lua and test it.
And you can add more dimensions if you want but you would need to edit the source code of minetest. It works with a mod too but it would cause too much lag.
Xenon wrote:Hybrid Dog wrote:Xenon wrote:Is there a way to register multiblock structures?
Also, is there a way to add different dimensions?
If so, I would love to know!
Of course, there are lots of ways to register structures with more blocks, you just need to find out the definition for these structures and then put it into lua and test it.
And you can add more dimensions if you want but you would need to edit the source code of minetest. It works with a mod too but it would cause too much lag.
What do you mean definition?
Xenon wrote:How would you make GUIs show up when you click with a tool?
local modnames = minetest.get_modnames()
for i, name in ipairs(modnames) do
-if modnames == "moreores" then
--if minetest.get_modpath("moreores") then
---dofile(moreores_modpath.."/moreores.lua")
--end
-end
end
for key,value in myTable do --pseudocode
value = "foobar"
end
benedict424 wrote:I'm completly new at lua, so I want to know if this will search for the moreores mod and run moreores.lua if found.
Reason: I want to add support to a mod.local modnames = minetest.get_modnames()
for i, name in ipairs(modnames) do
-if modnames == "moreores" then
--if minetest.get_modpath("moreores") then
---dofile(moreores_modpath.."/moreores.lua")
--end
-end
end
if minetest.get_modpath("moreores") then
-- Do something requiring moreores here.
-- Don't worry. Moreores is already loaded at this point,
-- if you specified it as described above.
end
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"group:water"},
interval = 45,
chance = 100,
action = function(pos)
pos.y=pos.y+1
minetest.add_node(pos, {name="korallen:pinkcoral"})
end,
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"group:water"},
interval = 60, -- interval per secnd
chance = 300, -- propability 1= always
action = function(pos)
pos.y=pos.y+1
minetest.add_node(pos, {name="korallen:bluecoral"})
end,
})
minetest.register_craftitem("korallen:pink_coral_grass",{
description = "pink colored coral top",
inventory_image = "koralle_top_pink.png",
wield_image = "koralle_top_pink.png"
--on_drop = function(itemstack, dropper, pos)
--itemstack:take_item()
--return itemstack
})
minetest.register_abm({
nodenames = {"korallen:pinkcoral"},
neighbors = {"group:water"},
interval = 45,
chance = 50,
action = function(pos)
pos.y=pos.y+1
minetest.add_node(pos, {name="korallen:pink_coral_grass"})
end,
})
Users browsing this forum: No registered users and 8 guests