Spigot Programming Minecraft: Programming Daily Commands?

Pa
9

I'm programming for 3 months with Spigot just wanted to make a reward system! The command should only be usable once a day, how can I do that?

Co

Write the time when a player has executed the command into a file or variable and just check if 24h have passed.

or the day of the month so you have no 24h restriction.

Pa

Could you tell me how to code a source code?

Co

Sorry but finding it on the WWW is not hard I do not make it so easy for you to take the work off, you should also learn something. With 3 months of experience, I trust you to.

Pa

OK, but I have not really spent time there or have never been so busy

Co

Yes then just google just how you get the system time?

In this modern world, it's easier than it was 20 years ago. (I'm not that old)

Co

Here for you:

Calendar cal = Calendar.getInstance ();
int dayOfMonth = cal. Get (Calendar.DAY_OF_MONTH);

String dayOfMonthStr = String.valueOf (dayOfMonth);

https://stackoverflow.com/...-the-month

1st search result: "java get day of month"

Co

I can't even find errors in my rank plugin

Co

Like Sender = Player you have to command = Reward

Everything is defined in the boot

Ka

Do it the way TobicsLP wrote it. For the method that only every 24 hours should be possible google just times to timestamps. But if you want to do it once a day, as soon as the player executes the command, they can enter the current date and player in a file / database, and thus check if the player has already used the order today.