Skript to Java

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

sandor_1234

Active Member
Jan 26, 2017
165
5
0
21
How do you use the:
code_language.skript:
Wait 3 seconds
in java? Cuz i need a sort off cooldown.
 
Schedule a BukkitRunnable.
Sorry i am really new to java, how would i do that with this code:
Java:
package nl.sandor.cooldown;
 
import java.util.HashMap;
 
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
 
public class listerner
implements Listener
{
@EventHandler(priority=EventPriority.HIGH)
public void onPlayerInteract(PlayerInteractEvent event)
{
    if ((event.getAction().toString().equals("LEFT_CLICK_BLOCK"))  || (event.getAction().toString().equals("LEFT_CLICK_AIR"))){
    if ((event.getItem().getItemMeta().getLore().contains(ChatColor.MAGIC + "$"))){
    if ((event.getItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "Empire Wand"))){
#set the lore to &kc
#Wait 3 seconds
#Set lore back to &k$
}
}
}
}
}
 
Sorry i am really new to java, how would i do that with this code:
Java:
package nl.sandor.cooldown;
 
import java.util.HashMap;
 
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
 
public class listerner
implements Listener
{
@EventHandler(priority=EventPriority.HIGH)
public void onPlayerInteract(PlayerInteractEvent event)
{
    if ((event.getAction().toString().equals("LEFT_CLICK_BLOCK"))  || (event.getAction().toString().equals("LEFT_CLICK_AIR"))){
    if ((event.getItem().getItemMeta().getLore().contains(ChatColor.MAGIC + "$"))){
    if ((event.getItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "Empire Wand"))){
#set the lore to &kc
#Wait 3 seconds
#Set lore back to &k$
}
}
}
}
}
Java:
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
            
            @Override
            public void run() {
                // After 3 seconds
                
            }
        }, 3*20); //20 TICKS = 1 SECOND