Jump to content

TekkitSense

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by TekkitSense

  1. my code so far my PlayerInteractEvent is not getting called and i got banned on bukkit forums for posting this same question package me.marshall; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; public class Main extends JavaPlugin implements Listener{ @Override public void onEnable(){ PluginManager pm = this.getServer().getPluginManager(); pm.registerEvents(PlayerInteractEvent, this); getLogger().info("SenseRestrict has been Enabled."); } @Override public void onDisable(){ getLogger().info("SenseRestrict has been Disabled."); } public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){ Player user = (Player) sender; if(cmd.getName().equalsIgnoreCase("restricted")){ user.sendMessage("§a§m---------------------------------------------"); user.sendMessage("§2->§4 Banned-Items:"); user.sendMessage("§2->§4 add some items here"); user.sendMessage("§a§m---------------------------------------------"); return true; } return false; } @EventHandler(priority=EventPriority.HIGH) public void onPlayerClickItem(PlayerInteractEvent e) { Player user = e.getPlayer(); if(user.getItemInHand().equals(Material.DIRT) && e.getAction().equals(Action.LEFT_CLICK_AIR) || e.getAction().equals(Action.LEFT_CLICK_BLOCK) || e.getAction().equals(Action.RIGHT_CLICK_AIR)|| e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){ user.sendMessage("§a§m---------------------------------------------"); user.sendMessage("§2->§4 That item can only be used in crafting."); user.sendMessage("§a§m---------------------------------------------"); } } }
  2. TekkitSense is a factions based pvp server with 100 slots of lag free game play. We use custom plugins to automate the server & enhance your gaming experience. Like all Tekkit servers we do have some banned items. Our staff are friendly and know what they are doing. So if you need help ask a staff member. Words can't really explain the amazing features of TekkitSense, you will just have to join and see for you self. Hope to see you! - TekkitSense Staff
×
×
  • Create New...