XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Invalid
    • Icon: Major Major
    • Java  8

      Eclipse IDE

      1.14.3

      spigot-api-1.14.3-R0.1-SNAPSHOT-shaded

    • 1.14.3
    • Yes

      How to write plugins that use items to get money and consume items

      @SuppressWarnings("deprecation")
      @EventHandler
      public void onPlayerInteract(PlayerInteractEvent e)
      {     
          Player p = e.getPlayer();
          if((e.getAction() == Action.RIGHT_CLICK_AIR) || ((e.getAction() == Action.RIGHT_CLICK_BLOCK)) && p.getItemInHand().equals(paper10))
           {
                  Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "eco give " + p.getName() + " 10");
                  }
          }
      

      paper10 is the new item I made in the plugin

            Unassigned Unassigned
            XiaoWen XiaoWen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: