how to run add item to inventory command without making a sound

Started by yeahhhpiehh on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to run add item to inventory command without making a sound

When i run "add # Item to target entity inventory" it plays the pickup sound. I've been looking for any way to not make that sound but all the posts i've found are asking how to make an item MAKE a sound. I basically want to transfer all items in a GUI to the inventory when closed ( like a crafting table ) (and no, i can't turn off block entities.)

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the best way i can think if…
Fri, 04/24/2026 - 08:29

the best way i can think if is doing linear search though the inventory 
This is the mcreator procedure i have written it in some sort of code format:

set number i = 0 #this is the indexing you will use in the for loop
set number GUICount = getItemCountFromSlot(0)  #getting the amount of items from the input/output slot 0
for each slot in inventory from [TargetEntity] get contents as [ItemstackIterator] {
      if [ItemstackIterator] == [air] {
            set [GUICount] [granite] in slot i}
            break
      }
      set number i = i + 1 # this updates
}
set number i = 0 #reset indexing
set number GUICount = getItemCountFromSlot(1) #getting the amount of items from the input/output slot 1

#It checks if the slot is air or none and 
#if it is then it places tthe block in that slot 
#otherwise it adds to i and checks the next slot

do this for each individual slot from the gui
Mind you THIS IS NOT CUSTOM CODE i just like writing it in code form to make you try to understand what you are doing