Mojira Archive
MCPE-185491

Unable to make data-driven items only available in commands.

After the 1.21.20 update it is no longer possible to create items that are available in commands like /give but not in the creative inventory. 

The "menu_category" property of data-driven items doesn't allow the item to show in commands like /give when its "category" property is set to "none", even when its "is_hidden_in_commands" property is set to false. In previous versions you could just do "category": "commands". 

The main issue is that when the category property of the menu_category component is set to none, then the game will ignore the is_hidden_in_commands property and hide the item from commands no matter what. 

I have provided a sample behavior pack which contains two items: Admin Sword A and Admin Sword B. The only difference between the two items besides their names is that Admin Sword B has its category set to items, while Admin Sword A has it set to false, but both items should work in commands because both of them have is_hidden_in_commands set to false, but only the Admin Sword B item shows up in commands. 

The Admin Sword A item has its menu_category property set to {"category": "none", "is_hidden_in_commands": false}. This should result in it being available in commands, but not in the creative inventory. The namespaced id of this item is bugsample:admin_sword_a. 

The Admin Sword B item has its menu_category property set to

{"category": "items", "is_hidden_in_commands": false}

. This results in it being available in commands but not in the creative inventory. The namespaced id of this item is bugsample:admin_sword_b. 

Steps to Reproduce:
1. Add the sample behavior pack. 
2. Try to run the command /give @s bugsample:admin_sword_aYou will see that the command gives an error. 3. Try to run the command /give @s bugsample:admin_sword_bYou will see that this command works. 

Observed Results:

When the "menu_category" property of the item is set to 

{"category": "none", "is_hidden_in_commands": false}

the item is not available in commands nor the creative inventory. 
The command /give @s bugsample:admin_sword_a does not work and does not give you the "Admin Sword A" item. 
 
Expected Results:
When the "menu_category" property of the item is set to 

{"category": "none", "is_hidden_in_commands": false}

the item should be available in commands but not the creative inventory. The command /give @s bugsample:admin_sword_a should work and give you the "Admin Sword A" item. 

Duplicate

8Crafter

2024-08-16, 01:53 AM

2024-09-13, 03:31 PM

2024-09-13, 03:31 PM

2

1

Unconfirmed

1.21.40.21 Preview - 1.21.23 Hotfix1.21.40.21 Preview, 1.21.30.22 Preview, 1.21.20, 1.21.30.23 Preview, 1.21.21 Hotfix, 1.21.30.25 Preview, 1.21.22 Hotfix, 1.21.23 Hotfix

-