How can I make an item to make the Player and his armor invisible?

Started by Reandom on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I make an item to make the Player and his armor invisible?

I'm creating a mod that adds special items that when right-clicked give an effect to the player, one of these items gives invisibility and I wanted the player's armor to become invisible when the item was used, can someone help me?

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
After contemplating your…
Wed, 02/19/2025 - 13:04

After contemplating your idea, I've devised an answer.

 

Make 4 itemstack global/local variable(someting like playerHelmet, playerChestplate, playerLegging and playerBoots) and set the player's helmet, chestplate, legging and boots to their respective variable.

Make a local/global variable(called someting like basePlayerArmor or...) and save the player's current armor into that variabe, then remove your player's armor and set attribute armor to basePlayerArmor and when the effect ends, set their armor to playerHelmet, playerChestplate, playerLeggings and playerBoots.

 

If you need an image, just ask.