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:
oh that's just because there…
Wed, 09/24/2025 - 12:00

oh that's just because there is no data to get from the item in the block try this,

try {

this will simply set the "test" text variable to "null" if there is no data

} catch(NullPointerException e) {test = "null";}

but you can do this instead,

} catch(NullPointerException e) {return;}

if you want to stop executing the procedure if there is no data

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wow, that's brilliant! It…
Wed, 09/24/2025 - 18:42

Wow, that's brilliant! It works, thanks!I admire that you understand such things :) As I understand only the basic functions included in Mcreator - I have no knowledge of Java and advanced functions. When I finish this mod (in a week, a month, or sometime), I'll send you the link xD

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What do you think about it? …
Tue, 10/21/2025 - 18:10

What do you think about it? :)

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That Brewing stand mk II ui…
Tue, 10/21/2025 - 19:56

That Brewing stand mk II ui looks SO cool!

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I recommend downloading it ;…
Tue, 10/21/2025 - 22:02

I recommend downloading it ;) and I invite you to visit my other mods ;)