Help , adding cooldown to sign?

Status
This thread has been locked.

Notifyz

x
Banned
Feedback score
128
Posts
2,523
Reactions
2,639
Resources
0
Hello!
As you can see from the tittle , does anyone know how to add cooldown to sign?
I have tried many methods but still ain't working.

Thanks!
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
Can you explain what you mean, you have tried "many different methods"? You mean plugins?
 

Notifyz

x
Banned
Feedback score
128
Posts
2,523
Reactions
2,639
Resources
0
Can you explain what you mean, you have tried "many different methods"? You mean plugins?
No xD , I tried many methods with hashmap and system.currenttimemillis() but I don't know it doesn't seems to be working...
 
Banned forever. Reason: Scamming (https://builtbybit.com/threads/notifyz-scam-report.515571/)

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
No xD , I tried many methods with hashmap and system.currenttimemillis() but I don't know it doesn't seems to be working...
This is the plugins section, not development help or whatever so I was unsure.

You can simply add the player name and time to a hashmap and make a runnable to remove them after that many seconds. If you want the cooldowns to save when you stop the server you'll have to save the name and times to a file or something then add them back to the hashmap when the server starts
 

Notifyz

x
Banned
Feedback score
128
Posts
2,523
Reactions
2,639
Resources
0
This is the plugins section, not development help or whatever so I was unsure.

You can simply add the player name and time to a hashmap and make a runnable to remove them after that many seconds. If you want the cooldowns to save when you stop the server you'll have to save the name and times to a file or something then add them back to the hashmap when the server starts


Let me remember you this is Minecraft community so , nothings wrong if I ask for help. I'm not the only one who posted 'help' in this section.
But h/e , thanks for information will try to figure something out...
 
Banned forever. Reason: Scamming (https://builtbybit.com/threads/notifyz-scam-report.515571/)

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
Let me remember you this is Minecraft community so , nothings wrong if I ask for help. I'm not the only one who posted 'help' in this section.
But h/e , thanks for information will try to figure something out...
Let me "remember you" that you won't get any help being rude. I did help you, so I don't even know why you had to say anything. You posted in the wrong section, and I told you.
 

j0navor

Feedback score
0
Posts
147
Reactions
46
Resources
0
@EventHandler
public void signInteract(PlayerInteractEvent e) {
Block block = e.getClickedBlock();
if(e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if(block.getType() == Material.SIGN || block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) {
Sign sign = (Sign) e.getClickedBlock().getState();
if(sign.getLine(0).contains("test")) {
e.getPlayer().sendMessage("Test");
set the player on the cooldown, this isnt tested so might have to tweak the code.
 

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
@EventHandler
public void signInteract(PlayerInteractEvent e) {
Block block = e.getClickedBlock();
if(e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if(block.getType() == Material.SIGN || block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) {
Sign sign = (Sign) e.getClickedBlock().getState();
if(sign.getLine(0).contains("test")) {
e.getPlayer().sendMessage("Test");
set the player on the cooldown, this isnt tested so might have to tweak the code.
Why are you spoonfeeding? I told him how to do it. This doesn't even include what he wants, he asked how to add a cooldown
 

j0navor

Feedback score
0
Posts
147
Reactions
46
Resources
0
Why are you spoonfeeding? I told him how to do it. This doesn't even include what he wants, he asked how to add a cooldown
I know i'm not spoonfeeding him, this is the event that will be used, im showing him were the cooldown goes. Its up to him to work out how to do it.
 

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
I know i'm not spoonfeeding him, this is the event that will be used, im showing him were the cooldown goes. Its up to him to work out how to do it.
You just gave him code, that's spoonfeeding.
 
Status
This thread has been locked.
Top