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)

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.