Skip to content

Overriding empty hand range via meta does not work #16828

@AsumFace

Description

@AsumFace

Luanti version

5.9.0-debug
5.10.0-debug
5.11.0-debug
5.12.0-debug
5.13.0-debug
5.14.0-debug

Built using clang 21.1.7

Operating system and version

Fedora Workstation 43

CPU model

Intel i7 4770k

GPU model

No response

Active renderer

No response

Summary

The API documentation states the following:

  • "": The player's hand, which is in use whenever the player wields no item.
    • Its range and tool capabilities are also used as a fallback for the wielded item.
    • It can be overridden to change those properties:
      • globally using core.override_item
      • per-player using the special "hand" inventory list

I read this as I should be able to set the "range" key on the empty hand to override the range per player. Tests in versions 5.9 (introduction of item_meta_range feature) and upward indicate that this never worked.

Steps to reproduce

A quick test with vanilla MTG + worldedit to run commands, creative mode disabled:

//lua local inv = core.get_player_by_name("singleplayer"):get_inventory() inv:set_size("hand", 1) local stack = inv:get_stack("hand", 1) stack:get_meta():set_float("range", 40) inv:set_stack("hand", 1, stack)

The effect is naught, nothing changes. The range remains at default.

I hope I'm not doing anything obvious wrong there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @ Script APIBugIssues that were confirmed to be a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions