#query.inventory_contains in attachables.json

1 messages · Page 1 of 1 (latest)

dusky spruce
#

I was wondering is it possible to make an attachble that checks for the item in the players inventory and if true will run the animation? Cause right now I can only get it to work if the player is holding it

#
    "format_version": "1.10.0",
    "minecraft:attachable": {
        "description": {
            "identifier": "nm:zombified_piglin",
            "materials": {
                "default": "entity_alphatest"
            },
            "textures": {
                "default": "textures/blocks/nm_plushie/zombified_piglin"
            },
            "geometry": {
                "default": "geometry.zombified_piglin_item"
            },
            "animations": {
                "first_person": "animation.player.pops.first_person",
                "3ra": "animation.player.pops"
            },
            "scripts": {
                "animate": [
                    {
                        "first_person": "c.is_first_person && c.item_slot == 'main_hand' && q.get_equipped_item_name == 'zombified_piglin'"
                    },
                    {
                        "3ra": "!c.is_first_person && c.item_slot == 'main_hand' && q.get_equipped_item_name == 'zombified_piglin'"
                    }
                ]
            },
            "render_controllers": [
                "controller.render.item_default"
            ]
        }
    }
}```
mortal ocean
#

Is this fix already @dusky spruce

dusky spruce
sly kelp
#

Inventory item detection a BP