#custom food that you can eat everytime you want (like golden apple or suspicious stew)
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D
Open question: #1203493895108042783
There isn't a quality you can add to make those items edible at all times, no.
What you can do instead is instead change those items to both be a food item that is always edible in vanilla (such as a golden apple) and use a combination of effect clear commands and the saturation effect to add or remove the effects/saturation value of said item in the reward function
oh yea cool idea
i change the beef with a golden apple but it was giving me the effects of the apple, I'm going to try the clear effect. I should put the command at the beginning and then the custom effects, right?
yes
The only problem is this may clear effects they previously had
But I'm not sure there's much you can do about that
yea i tested it and it didnt work but prob i did something wrong
first i only puted effect clear @s but it didnt work
then i try this and it didnt work aswell
oh ok
So it gives you effects but doesn't clear the other ones?
That's weird
That is odd, I was pretty sure the effects get applied before the reward function.
You may just need to clear the effects 1 or more ticks later by tagging the player in the reward function and then either scheduling a function or using a scoreboard to clear those players effects and remove the tag
Yea, I know absolutely nothing about the dialer starting recently with the datapacks, sorry. Don't you have a scoreboard template that I should add and in what file?
I don't
the effects get applied after the reward function plays, so that's the problem
but you can tag the player when eating the apple and react to it with another effects changed advancement
which checks if you have the tag and then clears the effects
you can use a blindness suspicious stew or smth similar for a much smaller chance they already have the effect
but then ofc it doesnt stack
so yeah you just give them a tag, schedule a function for 1 tick later, and have that function run a third function as @a[tag=whateveryoucalledthetag]
and in the third function remove the effects and tag
do you have a template or smth to make that? bcs idk how to make the schedule part
There's very few "templates" in the traditional sense in the world of data packs
Schedule is a specific command though, so myself and Lionlance have given you pretty much as detailed a description as there is for the steps to do short of writing the commands for you.
use /syntax schedule with the discord bot if you want to see the syntax for schedule, or look on the page commands/schedule on minecraft.wiki
it isnt too difficult to understand, it sets a command to run a function x ticks or seconds or days in the future as you set it
said function will always run as the server so you have to make it run a function as the player from the advancement function again to make that work
the function running as the server is a pretty annoying and random detail so i wanted to make sure you knew that, but otherwise you should probably be good
oh ok
schedule function <function> <time> [append|replace]
Adds a schedule.
schedule clear <function>
Removes a schedule.
i need to add this to the eat_<item>.mcfunction file?
i did this and now idk why its not reading the name
oh right
like that?
bcs it didnt work :( (btw i used another food but it has the same functions)
- You probably want/need to specify a unit of time after the one. In your case,
1t - Don't think you need the
append, though it may not be causing problems - What is
custom_food:crafted/eat_blue_berriefunction?
3: its the function that gives you the custom effects when you eat the item
so I need to delete append and put a t (which represents tick) next to 1?
To start with
Ok but what is in it? Can you show us?
rn im not in my computer, ill see if I have an image of tree
in this case im using eat_jungle_fruit.mcfunction
this
idk i was just following a tutorial
Ok, well right now the function is just scheduling itself, which will do nothing.
Do this
I don't know anymore tbh. You're sort of all over the place.
This thread has been inactive for some time, so I'm going to archive it.
If you're still using the thread, just send a message and it'll pop back on the thread list.