Hcf core

Status
This thread has been locked.

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
so im trying to make a hcf core, and for some reason this code doesnt work. it adds enderpearl: to the scoreboard and i cant use an enderpearl when its on, but when i use an enderpearl and the timer is off, then it adds the scoreboard, sends me the wrong message, but doesnt register the enderpearl:

public class EnderpearlEvent implements Listener {

@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
Player p = e.getPlayer();
PlayerScoreboard scoreboard = PlayerScoreboard.getScoreboard(p);
if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if(p.getItemInHand().getType() == Material.ENDER_PEARL) {
if(scoreboard.getEntry("enderpearl") == null) {
e.setCancelled(false);
new Entry("enderpearl", scoreboard)
.setCountdown(true)
.setText(ChatColor.GOLD + "Enderpearl:" + ChatColor.WHITE)
.setTime(16)
.send();
}
if(scoreboard.getEntry("enderpearl") != null) {
e.setCancelled(true);
p.updateInventory();
p.sendMessage(ChatColor.RED + "You are still on enderpearl cooldown!");
}
}
}
}

}

help would be appreciated, thanks!
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Fle

Top tier Random.
Supreme
Feedback score
11
Posts
1,025
Reactions
425
Resources
0

Edvio

Feedback score
8
Posts
351
Reactions
113
Resources
0
Can someone help him instead of Trash him? If there's something he doesn't understand, learn him it.
I already tried to help him, but he doesn't even understand what I'm talking about. He says he has basic Java knowledge, I highly doubt that since he doesn't even know how return works.
 
Status
This thread has been locked.
Top