Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4314

Add the ability to change the item in an item frame WITHOUT triggering the sound effect.

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • General Plugin Development

    • 26.08 23:15:01 [Server] INFO This server is running CraftBukkit version git-Spigot-2440e18-479ec05 (MC: 1.13.1) (Implementing API version 1.13.1-R0.1-SNAPSHOT)
    • none yet
    • Yes

      When using setItem(Material) on item frame using the spigot API, when the item is set the sound is triggered as if a player actually placed the item in the item frame.  For what I am doing it would be nice if said item frame was silent.

       

      private stockId = 0;
      private List<Material> stock = new ArrayList(Material.STONE, Material.COBBLESTONE, Material.GRAVEL);
      
      
      
      public void rotateStock() {
      		
      		if(!this.stock.isEmpty())
      		{
      			if(this.stockId >= this.stock.size())
      				this.stockId = 0;
      			
      			this.linkedFrame.setItem(new ItemStack(this.stock.get(this.stockId),1));
      			this.stockId++;
      		}
      		
      	}
      

      on each call of rotateStock() the sound for placing an item in the item frame is played, if this were on say a timer and stock was rotated once a second it would be undesirable.

       

      Steps to reproduce:

      1) Create plugin

      2) create array or array list of a few materials

      3) create an item frame in the world

      4) link the item frame in the world to your code

      5) have a way to invoke rotateStock() or similar code that sets the item manually.

      6) run plugin

      7) have sound on

      8) be near item frame

      9) trigger the code to set the item

      10) listen

      11) repeat 10-20x and experience the sound irritation.

            Unassigned Unassigned
            whoolieshop Shane Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: