Item with Registry Name

Started by myko on

Topic category: Help with MCreator software

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Item with Registry Name

Is there any procedure block that allows you to spawn an item using it's registry name? Maybe an item block like "Item with Registry Name"?

If I have a variable set to Ex. (minecraft:item), I'd like to be able to spawn that item using the variable.

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I was able to solve my issue…
Tue, 05/06/2025 - 12:08

I was able to solve my issue manually using the code editor, but the block would still be a very useful feature.

No need for code There is…
Tue, 05/06/2025 - 14:55

No need for code

There is procedure block to obtain item by its registry name in procedures.

There is also procedure block to spawn item. Just swap fixed item with "item from registry name" procedure block

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm on Mcreator version 2024…
Tue, 05/06/2025 - 19:26

I'm on Mcreator version 2024.4 and I can't seem to find that block anywhere, is it only on the later versions?

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've seen these "convert…
Thu, 05/08/2025 - 12:16

I've seen these "convert registry name to item" and "convert registry name to block" but I can't find any blocks similar to "Item from Registry Name" or "Block from Registry Name". The closest I found is "Random Item from Tag".

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
My old code (using procedure…
Thu, 05/08/2025 - 12:21

My old code (using procedure editor): (there was no "Item from Registry Tag" option)

new ItemStack((BuiltInRegistries.ITEM.getOrCreateTag(ItemTags.create(ResourceLocation.parse(((LootPlusConfigConfiguration.BOSSLOOTBAGDROP1.get())).toLowerCase(java.util.Locale.ENGLISH))))
    .getRandomElement(RandomSource.create()).orElseGet(() -> BuiltInRegistries.ITEM.wrapAsHolder(Items.AIR)).value()))

What I changed (in text editor): 

new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.tryParse(LootPlusConfigConfiguration.BOSSLOOTBAGDROP1.get().toLowerCase(java.util.Locale.ENGLISH))))