#Is it possible to toggle Resource Pack elements for players?

1 messages · Page 1 of 1 (latest)

vernal heath
#

Context: I want the appearance of the armour bar to change with the armour material equipped

Alternatives:

  • Using a display entity with interp for this element in Paper/Spigot and modifying it, while hiding the HUD element entirely with the resource pack
  • Using the XP bar, etc. (other components) for this as they won't be in use
  • Switching the resource pack entirely for the player ❌ Bad solution

Requirements:

  • Without armour, no armour bar is shown ✅ Vanilla
  • With iron chestplate, the armour bar is blue
  • With netherite chestplate, the armour bar is orange with a different number of icons (same "progress"/"size")

Using:

  • Paper/Spigot (so a solution relying on these is ideal - but a generic "method" is even better!)
mortal jasperBOT
#
**Someone will come and help soon!**

💬 While you wait, take this time to provide more context and details. What are you trying to achieve overall - maybe there's an easier way to solve this problem

🙇 If it's been 30 minutes and you're still waiting for someone to help, hit the Summon Helpers button to call the official helpers here

✅ Once your question has been resolved (or you no longer need it), hit the Resolve Question button or run /resolve

cloud rune
#

vanilla shaders would be able to do this.

vernal heath
#

including changing the shape of them, not just the colour? i'd be interested in a guide for that if you have one, not touched shaders but im curious about guis

quasi dune
#

Inherently if something exists you can use shaders to screw with it in some way probably

#

It’s just as you get to things that are more inherent to the game working as it is the harder it is to screw with them in a way that works effectively on everything

#

GUI elements are especially bad if you don’t know what you are doing with shaders

#

For one simple reason actually

#

GUI scale

vernal heath
#

did find an ancient datapack/resource pack now that did this by hiding the armor outright and sending to action bar with a custom font (of icons)

doesn't feel like a great solution though, very inefficient and means i cant use action bar if i need to - and not sure it works with varying widths anyway

i will look into shaders but if they're that complex might have to try another way

leaden gust
#

which i really need to learn

vale mantle
#

Actually, not sure if vanilla shaders can react to you changing your armor.
The shader is very limited on what it knows but very powerful when it comes to changing something

#

And gui elements are solely rendered by core shaders, which know the fewest information

#

And it’s hard to send into to the armor bar rendering shader since you can’t modify the armor bar at all and different armors don’t do so uniquely

#

TL;DR
You are better off using the action bar

vernal heath
vale mantle
#

Don’t think you can send that information to the shader, also not using a plugin but I'm not sure, there are very cursed packets

cloud rune
vale mantle
#

Yea no, that way you can only react to it using a post shader

#

And iirc all Post shaders Start behind the gui

#

So they don’t affect the armor bar

vale mantle
vernal heath
#

how about hijacking the exp bar as it isnt used in this gamemode and can be modified in spigot?
progress = fullness of bar
level = which type of bar to use (i believe i'd only need 2 backgrounds and 2 foregrounds, that i can tint the colour of)

#

that works for my use if its a feasible way to do it

vale mantle
#

that could work but writing the shader will still be a lot of work

#

and if you don't know how to write shaders then that's a long learning process for that effect

#

I've been making vanilla shaders on and off for quite some time now and i would need to experiment a lot before having something resembling what you need

vernal heath
#

i did poke around the shaders and make some prototypes, was able to achieve a little offhand map -> minimap, think ill be able to achieve it so ill go the xp route

#

appreciate the help and did find some great resources by searching around here

#

ill put it together maybe later today, could post the final result here if its useful to anyone?

vale mantle
#

sure

#

if it's something to show, consider putting it into #1112960948655902751

vernal heath
#

neat, thanks for pointing that out 👍

#

didnt get around to it cus busy with uni work but ill be sure to put it there when i get to it, could be a useful thing to just swap in images and locations on screen

mortal jasperBOT
#
:white_check_mark: Closed Question

Closed the channel and marled it as resolved!
If you have more questions feel free to ask them in a new channel!