Overrided the default item behavior and then added custom logic for the item’s behavior: adds the full stack of the first item in the hot bar to every empty inventory slot. Logic run-down: use a for loop to iterate through the person inventory and check if the slot is empty, then copy the first item (stored first in a variable) to that empty slot.
In the ModItems Java class, I set up a registry for the custom item. First, we create a differed register using “GodBoxMod” which is the custom mod file. Second, use an arrow function to register the item as an object in the game. Third, eventbus is a function that ensures the item is in the game. In the GodBoxMod file (the custom mod file), I added the custom item to the creative tab. Small tasks included (mostly code that took one line): registering the eventbus which is the event of the custom item, set the texture for the custom item in a custom json file, set the title of the custom item (seen in the game) in a custom json file.