Skip to content

"wieldview" does not support changes to textures via metadata #170

@skylord-at-hub

Description

@skylord-at-hub

Wielded items in third person does not update after the texture has been updated via metadata.
You can test youself using the command Im providing below:
Notice: This command assumes you are testing on minetest_game

core.register_chatcommand("change_sprite", {
    description = "change texture of existing item to diamond sword",

    func = function(name, param)
        local player = core.get_player_by_name(name)
        local stack = ItemStack(player:get_wielded_item())

        if not player or stack:is_empty() then
            return false, "You arent real or your not holding an item"
        end

        local meta = stack:get_meta()
        meta:set_string("inventory_image", "default_tool_diamondsword.png")
        meta:set_string("wield_image", "default_tool_diamondsword.png")
        player:set_wielded_item(stack)
        return true, "Success! Changed texture to diamond sword"
    end,
})

Press the "Toggle camera" button (c by default) until you are in 3rd person. You will notice that you arent holding a diamond sword (even though the textures have been changed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions