SOLVED: Fast mining/digging without tool
SOLVED: Fast mining/digging without tool
Hi there,
I hope this is the right board for my question.
I'd like to enable fast digging for all players without a tool in creative mode. I was looking for a configuration switch or a mod out there, but wasn't able to find one. I found the tools.lua but I'm new to lua and Minetest modding and lack the idea of what I would have to modify there.
Any help appreciated.
Have fun,
freefall.
I hope this is the right board for my question.
I'd like to enable fast digging for all players without a tool in creative mode. I was looking for a configuration switch or a mod out there, but wasn't able to find one. I found the tools.lua but I'm new to lua and Minetest modding and lack the idea of what I would have to modify there.
Any help appreciated.
Have fun,
freefall.
Last edited by freefall on Thu Jan 14, 2021 21:11, edited 1 time in total.
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Fast mining/digging without tool
What exactly do you mean? Creative mode?
- AspireMint
- Member
- Posts: 415
- Joined: Mon Jul 09, 2012 12:59
- GitHub: AspireMint
- IRC: AspireMint
- In-game: AspireMint
- Location: Stuck at spawn
Re: Fast mining/digging without tool
Super fast digging:
create new mod, init.lua:
create new mod, init.lua:
Code: Select all
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
local player_name = puncher and puncher:get_player_name() or ""
if not minetest.is_protected(pos, player_name) then
minetest.node_dig(pos, node, puncher)
end
end)
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Fast mining/digging without tool
If you create a new mod anyways, why not simply override the tool capabilities of : (which is the hand)?
- AspireMint
- Member
- Posts: 415
- Joined: Mon Jul 09, 2012 12:59
- GitHub: AspireMint
- IRC: AspireMint
- In-game: AspireMint
- Location: Stuck at spawn
Re: Fast mining/digging without tool
Isn't my solution simple enough, I believe there are more options, but will that ":" also override tool capabilities of other tools?
Please, provide some code. Thanks.
Re: Fast mining/digging without tool
@AspireMint
Wow, that is really super fast... Frankly, for me, this is too fast. Is there a way to modify your code to end up with something like 1-3 punches per block, no matter which material is involved?
Wow, that is really super fast... Frankly, for me, this is too fast. Is there a way to modify your code to end up with something like 1-3 punches per block, no matter which material is involved?
Re: Fast mining/digging without tool
I do not really need to differentiate. But I'd assume that in survival mode, the digging/mining speed is essential for the balance of the game. In creative mode, players have access to all materials and they want to build what's on their mind without game mechanics stepping in their way.
In Minecraft, you can mine/dig a lot faster - and without the need of switching tools - in creative mode than in survival mode. I'd like to see about that speed in Minetest creative mode, too.
- AspireMint
- Member
- Posts: 415
- Joined: Mon Jul 09, 2012 12:59
- GitHub: AspireMint
- IRC: AspireMint
- In-game: AspireMint
- Location: Stuck at spawn
Re: Fast mining/digging without tool
Yup, but now i think overriding tools as Linuxdirk said would simpler,
but then you can't set digging time to any value (there are some limits).
Correct me if im wrong.
So here is modified my solution: https://github.com/AspireMint/fast_puncher
To set digging time (any), just edit first/second line of init.lua.
You wont see digging animation with this mod :-(
But digging with any tool takes same time to dig node.
(mod can be buggy so use at your own risk x) )
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Fast mining/digging without tool
No, it won’t, don’t worry.AspireMint wrote: ↑Thu Jan 14, 2021 14:51but will that ":" also override tool capabilities of other tools?
Basically the hand is just a tool with benefits :) You can easily modify, replace, override, or change it without affecting anything else – like every other tool. : can be overridden by just using an empty string as item in minetest.override_item().
Code: Select all
-- Only alter the “hand tool” when in creative mode, otherwise return early
-- and do nothing.
local is_creative = minetest.is_yes(minetest.settings:get('creative_mode'))
if is_creative == false then return end
-- The times set here cause nodes to be broken/dug with three punches and
-- regardless of group.
local desired_times = { [1] = 0.7, [2] = 0.7, [3] = 0.7 }
-- Alter the hand after all other mods are loaded so mods that modify the
-- hand run first and not override our overrides.
minetest.register_on_mods_loaded(function()
minetest.override_item('', {
tool_capabilities = {
groupcaps = {
-- You can add groupcaps for more groups here if needed
oddly_breakable_by_hand = { times = desired_times },
dig_immediate = { times = desired_times },
crumbly = { times = desired_times },
cracky = { times = desired_times },
choppy = { times = desired_times },
snappy = { times = desired_times },
}
}
})
end)
About the dig_immediate group
About the other groups
About the hardcoded 0.15 seconds pause
… just read the whole chapter :)
Re: Fast mining/digging without tool
That's exactly what I was looking for. 0.5 works fine for me. No problem with the missing animation.AspireMint wrote: ↑Thu Jan 14, 2021 20:07So here is modified my solution: https://github.com/AspireMint/fast_puncher
Thank you very much.
Have fun,
freefall.
Re: Fast mining/digging without tool
This would go into an init.lua of a mod, as well, right?
EDIT: It does.
Have fun,
freefall.
Last edited by freefall on Thu Jan 14, 2021 21:12, edited 1 time in total.
Re: Fast mining/digging without tool
This solution also provides the animations. Wonderful. Thanks to both of you!
Have fun,
freefall.
Who is online
Users browsing this forum: No registered users and 5 guests