Item components in custom commands aren't retained - (2025.3)

Started by TheGameCrafter13 on

Topic category: Feature requests and ideas for MCreator

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Item components in custom commands aren't retained - (2025.3)
  • MCreator Version: 2025.3.45720
  • Minecraft version (generator): NeoForge for 1.21.1 (21.1.190)

So making a command with an "item parameter" block allows the user to make commands that utilize item lists as auto-complete suggestions (similar to how "/give" grabs a list of all items.)

 

But an inconsistency I found is although you can use brackets [] to specify component data, NONE of that gets carried over to the command item.

 

So purely as an example making a custom command like "/giveme @p minecraft:wooden_sword[minecraft:damage=30]" won't behave like "/give" would.

 

Looking at the actual generated code shows the cause of this appears to be "getDefaultInstance"

(ItemArgument.getItem(arguments, "item").getItem().getDefaultInstance());

 

So without looking at the code I thought this was a bug. But now I see that makes this post a "feature request" for consistency.