Yeah its called giving early access to all of my members, the thing I say at the end of every single video. In reference to the comment you left on my other video
Anyone that does not want to have to code the cooldown everytime you need one you can make a timerutil class were you can start, stop, and keep track of a certain players cooldown pretty easily and pretty much is the same thing he did here but in its own class and there should be methods to start, stop and get the current time remaining
There are no ready-made plugins for cool down commands, relative to status for example. vip - /heal cooldown is 300s. premium - /heal cooldown is 10s. LuckPerms? Essentials? How to do that? ps. For server) I planned to try to make a server, and I had enough coding when I was making a mod)
hey u prob found a solution by now lol but just in case anyone else sees this in the future, when you compress the code to avoid repeating the lines you have to make sure the computation calculates the difference between the milliseconds first and after that you substract the 10000. I did mine with seconds so here is how. (10000 - (System.currentTimeMillis() - cooldown.get(p.getUniqueId())) ) / 1000
@@KodySimpson yea but what I meant just realized I didn't explain it good enough. What I meant was can I change it so it shows how many seconds till they can run the command again not milliseconds becasue it looks ugly
I think you can do this with BukkitRunnable, for example every 10 ms you can decrease the time. The only issue is that if you set the delay of the runnable to 1ms the server becomes kinda laggy sometimes
There's no point of using a bukkitrunnable for a cooldown unless you want the notification. Just store the instant/tick it started, and check that next check, or schedule a reminder to tell people when it's up.
can u make a video on how to make custom ranks like OWNER,ADMIN etc and also get persnol cool commands only for ranked player. And a nick feature when u type /nick it changes your name which is above your head (username) and in the chat like hypixel has plz? im trying to make a server
I love how he keeps his voice serious while saying "so the command is /fart"
:D
the burp caught me by surprise lol
You can make a class "CooldownCommand" and then inherit from it. So you don't have to write that code every time a command needs cooldown.
amazing explanation, thanks
Glad it was helpful!
omg finally a good spigot youtuber
;)
Oh sorry me, just second ago TH-cam sent me notification about this video... You are great
Yeah its called giving early access to all of my members, the thing I say at the end of every single video. In reference to the comment you left on my other video
Anyone that does not want to have to code the cooldown everytime you need one you can make a timerutil class were you can start, stop, and keep track of a certain players cooldown pretty easily and pretty much is the same thing he did here but in its own class and there should be methods to start, stop and get the current time remaining
There are no ready-made plugins for cool down commands, relative to status for example.
vip - /heal cooldown is 300s.
premium - /heal cooldown is 10s.
LuckPerms?
Essentials?
How to do that?
ps. For server) I planned to try to make a server, and I had enough coding when I was making a mod)
Thank you man, finally I have cooldown for my kits, not as a command
Yaay, thx for this video, it's helped me a lot!
is there a way to fit all of this into one variable? dont wanna make like 10 different hashmaps for cooldowns.
A class!
Kody burps are the best
Cannot invoke "java.lang.Long.longValue()" because the return value of "java.util.HashMap.get(Object)" is null when the code activates
can you add the , before e.g. 5 and after 301? like 5,301
1:06 Чё рыгаем?
ni che
nice video!
1:07 genius AHHAHAHAHhahahah
How Do You Get The Greater Than Or Equal To Sign? I tried but it says illegal character
>=
What font do you use in your ide
jetbrains mono
👍
Why is this 10h ago? Why so late compared to the rest?
Edit: lmao I got solution using a hahsmap too, code a problem? Use a hashmap!
#kodyforpresident2022
Agreed
Why are the milliseconds now in negative
hey u prob found a solution by now lol but just in case anyone else sees this in the future, when you compress the code to avoid repeating the lines you have to make sure the computation calculates the difference between the milliseconds first and after that you substract the 10000. I did mine with seconds so here is how.
(10000 - (System.currentTimeMillis() - cooldown.get(p.getUniqueId())) ) / 1000
Hey kody! Is it possible to change the time into seconds? Milliseconds just look annoying for me
Yep, said this in the vid a couple of times. You have the code in front of you, 1000 ms is 1 second
@@KodySimpson yea but what I meant just realized I didn't explain it good enough. What I meant was can I change it so it shows how many seconds till they can run the command again not milliseconds becasue it looks ugly
@@marcelooo1329 Just divide these miliseconds by 1000 and round that if you want to
yeah just divide it by 1000 then you get seconds
@@duckking404 but how?
I think you can do this with BukkitRunnable, for example every 10 ms you can decrease the time. The only issue is that if you set the delay of the runnable to 1ms the server becomes kinda laggy sometimes
Yeah, I was thinking about showing that but it seemed kinda like overkill cuz a hashmap seems to work perfectly
or whatever data structure
BukkitRunnables kinda lag the server by just a tiny bit
There's no point of using a bukkitrunnable for a cooldown unless you want the notification. Just store the instant/tick it started, and check that next check, or schedule a reminder to tell people when it's up.
The ideal method would be using a cache that expires, to prevent memory leaks for public servers that don't restart for like a month or more.
can u make a video on how to make custom ranks like OWNER,ADMIN etc and also get persnol cool commands only for ranked player. And a nick feature when u type /nick it changes your name which is above your head (username) and in the chat like hypixel has plz? im trying to make a server
Yes
The per rank commands are simple with permissions from earlier videos
second
third
fourth