How to make a item or armor display on the player without using one of the armor slots

Started by MaxPaxTY on

Topic category: Help with modding (Java Edition)

Last seen on 02:44, 21. Feb 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a item or armor display on the player without using one of the armor slots

I've been wondering if its possible to display a item or armor on the player if they press a button or do a certain action without the armor slots being used. if not, how can I make it so that if the player has armor and they use the button they get a new armor and when they press it again they get back their original armor. I'm not really sure if I'm explaining it well but I hope someone can help with this.

Last seen on 09:33, 25. Apr 2024
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know if you can…
Mon, 03/06/2023 - 19:12

I don't know if you can display an armor without the armor slot being used, but it's totally possible to change the armor with an other. You have to create all the armor you will need. 
For example the "armor 1" can replace the "armor 2", so the "armor 2" can replace the "armor 1". 
The procedure will look like that :

When the keyboard is pressed :
	If armor slot contain [armor 1]:
		remove [armor 1]
		set [armor 2]
	Else, if armor slot contain [armor 2]:
		remove [armor 2]
		set [armor 1]

 

I can help you to create this procedure with more armor, but only if you explain to me how we can know what armor have to replace other armor.