How can I transfer an entity-typed variable between 2 items so the entity is targetable on the receiving end?

Started by Dokneso on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 months ago
Joined Mar 2022
Points:
514

User statistics:

  • Modifications: 0
  • Forum topics: 12
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 7
How can I transfer an entity-typed variable between 2 items so the entity is targetable on the receiving end?

Baasically I have a procedure that is activated upon right-clicking with an item. It replaces the current item with another one and sets an entity variable as the current target entity. How can I make it so the replaced item has a variable with the same entity stored as the one in the 1st item for me to use in it's procedure? I've thought of giving the item a text tag with the UUID of the entity, but it isn't possible to decode it into an entity.