Obtaining data from an item. (Tag, ID etc.)

Started by VegaOrionis on

Topic category: Help with MCreator software

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Obtaining data from an item. (Tag, ID etc.)

Hello, I'd like to obtain specific item data, specifically the tag. Using the "/data entity" command, I can also see information about items in my inventory and their data. I'd like to obtain this data in MCreator for a specific item, but I don't know how to extract it. I've tried various combinations, but I must be doing something wrong... I'm not getting any feedback when testing. 


https://imgur.com/a/OcH5NfK

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Actually, that's not fully…
Wed, 09/24/2025 - 07:18

Actually, that's not fully true I also use IntelliJ IDEA to get the right code for the .java.ftl

In IntelliJ IDEA I use the Minecraft Development plugin.

The free version of IntelliJ IDEA is called IntelliJ IDEA Community Edition.

 

And for the plugin I made for you, since the Minecraft Development plugin only has forge version down to 1.16.1 I used this website instead https://mcstreetguy.github.io/ForgeJavaDocs/

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just to be clear I didn't…
Wed, 09/24/2025 - 07:27

Just to be clear I didn't pay for IntelliJ IDEA, I use IntelliJ IDEA Community Edition

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
OK, thanks, maybe I'll look…
Wed, 09/24/2025 - 07:50

OK, thanks, maybe I'll look into it sometime ;)

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I wonder how to write this…
Wed, 09/24/2025 - 08:53

I wonder how to write this code :"((PlayerEntity)entity).openContainer.getSlot((int)slot_id).getStack().getTag().toString()"

so that I can enter my own coordinates and it works regardless of whether the block is open. I'd like to be able to call the procedure regardless of whether the block is open.

Enter the block coordinates and the slot number from which you want to retrieve the "tag".
without plugins

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you'd have to write it as,
Wed, 09/24/2025 - 09:00

you'd have to write it as,

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is my favorite of all…
Wed, 09/24/2025 - 09:21

This is my favorite of all. Thanks :)

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Theoretically, everything…
Wed, 09/24/2025 - 09:48

Theoretically, everything would be fine if it weren't for the fact that my game crashes immediately when these commands are executed every 1 tick... ugh.. ;_;  
https://imgur.com/a/Xti0719

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Of course I disabled the …
Wed, 09/24/2025 - 09:53

Of course I disabled the "send to all player" command

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ah... in fact, the procedure…
Wed, 09/24/2025 - 10:12

ah... in fact, the procedure "custom code.." is still running because it checks all the time in "if" 

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah local variables don't…
Wed, 09/24/2025 - 10:22

yeah local variables don't like "carry over" so when the procedure is done/reaches the last block; all local variables are "cleared"