Download (30 KB)

How do I install this?

Offhand Items

This is a port of mcl_offhand for use with any other Minetest subgame. Instead of using the offhand as a shield slot, this mod lets you use it for any item of your choice. You can switch items between hands by pressing a configurable button (by default aux1 or E). When using a tool, press right-click to use the action of your offhand. This lets you place torches and other nodes without having to put away your sword or pickaxe.

This mod should work with any game and configuration. However, the following mods are recommended to make the most out of it:

  • visible_wielditem - Attaches a 3D preview of the held item in your main hand. Recommended for visual consistency. Disable the wieldview mod if you also use 3d_armors.
  • wielded_light - Registers held items as light sources. Also works for items in your offhand. You might also be interested in the 3d_armor_light extension.

Credit & License

This mod is licensed under GNU GPL v3 like the original. Check Mineclone 2's Credit section for information on the original authors.

The wielditem.lua is forked from visible_wielditem by appgurueu. That specific file is dual-licensed under GNU GPL v3 as well as MIT.

Texture pack in the screenshot is Soothing32 (CC BY SA-4.0).

Reviews

Review

Do you recommend this mod?

  • Very handy mod

    This is a really good mod. However, it uses the same key as the stamina mod, so when you try to sprint (I use the stamina mod). However, this mod lets you to change your offhand key to one of the other controls (I use the zoom key). There is a bug where if a liquid source block is sent to the offhand key, then you get softlocked (I assume that one can clear inventory manually to be able to play in the world again). Other than that, this is a great offhand mod! :D Edit: The bug has been fixed. Thanks for the quick response! :)

    5 comments
  • Good mod

    It's very useful, especially when combined with Wielded Light, it makes exploring caves less "hurting to the eyes".

    0 comments
  • Great mod

    It can actually help a lot, but the main purpose I wanted this mod was to use a torch in the left hand together with the Illumination mod, but it seems like the mods aren't compatible. If this feature could be implemented, it would be an ideal tool for mining. It would also be nice if the item that is hold in the left hand could be seem in the left side of the screen while you are in First Person perspective. However, I think the mod is awesome, and with what I just said, it would be even more amazing.

    1 comments
  • Fine, but...

    I suppose this mod is good because it is on mineclone 2 but I'm not sure if it works for me, do I need a specific version of minetest?

    2023-06-24 10:06:19: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'controls' in callback environment_Step(): /media/home/mathieu/.minetest/mods/offhand/init.lua:149: attempt to perform arithmetic on local 'pos1' (a table value) 2023-06-24 10:06:19: ERROR[Main]: stack traceback: 2023-06-24 10:06:19: ERROR[Main]: /media/home/mathieu/.minetest/mods/offhand/init.lua:149: in function 'get_pointed_thing' 2023-06-24 10:06:19: ERROR[Main]: /media/home/mathieu/.minetest/mods/offhand/init.lua:182: in function 'func' 2023-06-24 10:06:19: ERROR[Main]: /media/home/mathieu/.minetest/mods/controls/init.lua:55: in function </media/home/mathieu/.minetest/mods/controls/init.lua:42> 2023-06-24 10:06:19: ERROR[Main]: /app/share/minetest/builtin/game/register.lua:422: in function </app/share/minetest/builtin/game/register.lua:406> 2023-06-24 10:06:19: ERROR[Main]: stack traceback:

    2 comments