Jump to content

How would I disable right clicking with the minium stone


Recommended Posts

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{



    public void onEnable(){

        PluginManager pm = this.getServer().getPluginManager();

        pm.registerEvents(PlayerInteractEvent, this);

        getLogger().info("SenseRestrict has been Enabled.");




    public void onDisable(){

        getLogger().info("SenseRestrict has been Disabled.");



    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){

        Player user = (Player) sender;



            user.sendMessage("§2->§4 Banned-Items:");

            user.sendMessage("§2->§4 add some items here");


            return true;


        return false;




    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("§2->§4 That item can only be used in crafting.");






Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...