How do I add shader when player eats/uses a specific item 1.20.1

Started by Moray on

Topic category: Help with modding (Java Edition)

Last seen on 01:26, 21. Jul 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I add shader when player eats/uses a specific item 1.20.1

How do I make it so when a player eats a specific item they get one of the shader effects from minecrafts Super secret settings?

if this is not possible, how do I make it so when a player eats a specific item they get an animated overlay for like a minute?

Thanks!

Last seen on 19:55, 25. Jul 2024
Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Minecrafts Secret Settings…
Fri, 07/19/2024 - 23:13

Minecrafts Secret Settings shaders are no longer a thing, so you would have to make your own animated overlay then use a procedure which displays the overlay for the desired amount of time after eating your food.

  1. Create your overlay texture/animated texture using either MCreator or, (if you need something big enough to cover the screen) an external photo editor or digital art program.
    1. In order to make an animated texture for your mod that does not use the default textures, you will have to make your textures frame by frame.
       
  2. Create an animated texture and import your frames 1 by 1 in order from first frame to last frame and change settings how you want them. (Make sure to test the animation to see if it looks how you want)
     
  3. Create an overlay mod element and use this texture to cover the entire screen
     
  4. I recommend creating a global variable of type PLAYER_LIFETIME and set it as a number which defaults to 0
     
  5. Create a procedure in your overlay element which returns true if this variable is greater than 0
     
  6. Make a "when finished using" trigger procedure for your food which sets your custom variable to (20*second) based on how long you want your overlay to last
     
  7. Make 1 last procedure with the global trigger "on player tick" which checks to see if your variable is above 0, and if so, sets your variable to yourvariable - 1