• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • Minecraft 1.16.220 Update + Bug/Crash Fixes
    Added MCPE 1.16.220 version and fixed crashes for multiple plugins. You can view the full changelist here.
  • Forum Updates - 4/11/2021
    Various changes have been made to the forums and a few categories. You can view the full changelist here.

food command with 24 hours Cooldown

Warning!
Hello , there have been no replies in this thread for more than 30 days.
Please make sure you have a valid reason before you reply to this thread or you may face moderation action.

Null45

Coal Miner
#1
cmd create food
cmd add food load %cdfood%
cmd add food if varset(%cdfood%) = %false% then goto 8
cmd add food if varset(%cdfood%) = 0 then goto 8
cmd add food if varset(%cdfood%[%p%]) = %false% then goto 8
cmd add food if %cdfood%[%p%] = 0 then goto 8
cmd add food message %p% [Feeder] You can only use this command once every 24 hours!
cmd add food exit
cmd add food # foods
cmd add food let %inv% = playerinventory(%p%)
cmd add food %food% = array(# FOOD ID)
cmd add food let %newinv% = %inv% + %food%
cmd add food carry %p% %newinv%
cmd add food let %cdfood%[%p%] = 1
cmd add food save %cdfood%
cmd add food message %p% [Feeder] You now need to wait for 24hours to get a free food!
cmd add food sleep 86400
cmd add food load %cdfood%
cmd add food let %cdfood%[%p%] = 0
cmd add food save %cdfood%
cmd add food message %p% [Feeder] You can now get Free food!
cmd create food2
cmd add food2 load %cdfood%
cmd add food2 let %cdfood% = 0
cmd add food2 save %cdfood%
cmd trigger startup food2
cmd unregister food2

Credits @XxMagmaCreeperxX for helping me fix typos