#custom food that you can eat everytime you want (like golden apple or suspicious stew)

1 messages · Page 1 of 1 (latest)

coral trailBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 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

#
⚠️ You already have a question open!

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

solid crane
#

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

fiery sable
#

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?

frigid compass
#

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

fiery sable
#

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

frigid compass
#

Is the function being run?

#

Just put like say test there to check

fiery sable
#

k

#

i think its working bcs its giving me the custom effects

frigid compass
#

oh ok

fiery sable
frigid compass
#

So it gives you effects but doesn't clear the other ones?

fiery sable
#

yup

#

weird

frigid compass
#

That's weird

solid crane
#

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

fiery sable
#

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?

solid crane
#

I don't

rancid holly
#

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

still moat
#

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

fiery sable
#

do you have a template or smth to make that? bcs idk how to make the schedule part

solid crane
#

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.

still moat
#

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

fiery sable
#

oh ok

timid lichenBOT
#
📜 /schedule

schedule function <function> <time> [append|replace]
Adds a schedule.
schedule clear <function>
Removes a schedule.

fiery sable
#

i need to add this to the eat_<item>.mcfunction file?

#

i did this and now idk why its not reading the name

solid crane
#

Its in the crafted folder

#

The function is custom_food:crafted/eat_blue_berrie

fiery sable
#

oh right

#

like that?

#

bcs it didnt work :( (btw i used another food but it has the same functions)

solid crane
#
  1. You probably want/need to specify a unit of time after the one. In your case, 1t
  2. Don't think you need the append, though it may not be causing problems
  3. What is custom_food:crafted/eat_blue_berrie function?
fiery sable
#

3: its the function that gives you the custom effects when you eat the item

fiery sable
solid crane
fiery sable
#

rn im not in my computer, ill see if I have an image of tree

#

in this case im using eat_jungle_fruit.mcfunction

solid crane
#

What is in that function?

#

I don't care where it is

fiery sable
solid crane
#

Oh, that function is scheduling itself then

#

Why?

fiery sable
#

idk i was just following a tutorial

solid crane
#

Ok, well right now the function is just scheduling itself, which will do nothing.

fiery sable
#

i need to run that in the advancement file right?

#

eat_jungle_fruit.json i think

solid crane
#

I don't know anymore tbh. You're sort of all over the place.

fiery sable
#

k np o7

#

ty

coral trailBOT
#
🗑️ Recycling Thread

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.