Output slots

Started by sideswipeBL on

Topic category: Help with modding (Java Edition)

Last seen on 07:33, 4. Apr 2022
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Output slots

I've been trying to make a meat grinder block that takes in two items through a GUI - raw beef in one input slot, and my custom item the Redstone Battery in another, and then in an output slot it will make ground beef. On the Wiki, it says this:

Putting items in Output Slots

  1. Add an Event (In blocks, items, guns, slots, etc.)
  2. Select: Place items in GUI slot
  3. Write the ID of your Output slot (visible on the GUI, it's a number like 02)
  4. Write the name of the Inventory of your Output slot
  5. Select the item that you want to put in and select the amount.

First of all, I don't know what the hell they mean by Add an Event. In? You don't add events IN things, you add them TO things. Also, what do I add them to? Anything? To the block that the GUI is assigned to? To the item(s) I want it to consume? And how do you add events to slots - since when could we do that?

Second of all, there is no "Place items in GUI slot" event. Nowhere. It is not listed. It just doesn't exist.

So how on Earth does this even work - and is it even possible?

Last seen on 14:59, 4. May 2018
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have found that there has…
Mon, 02/26/2018 - 23:36

I have found that there has been some bugs with GUI slots crashing and whatnot, so I'm not sure that they will work until the next update, however I can explain what they're talking about. :P

So to output your item (You need to be on the GUI editor for your GUI):

  • When you create an 'Input Slot', it will give you the option to add events to it; here you can also 'Limit stack input to:', which is supposed to allow only that item in the slot.
  • Click 'add event result', scroll down and find the event called 'Place item in GUI slot'.
  • You need to put the ID of the slot in the first box. (The ID of your slot in in the top right corner E.G 02) - if your ID was 02, you simply miss out the '0' and just put 2 :)
  • Next type in the name of your Inventory in the next box.
  • Select the item you want to place in the output slot, and type the amount.

 

I think were you have got confused, is that the Wiki has said 'In blocks, items, guns etc...', but the events you need are in the Slot events.

As I said above, I'm not sure that this will work - GUI is very buggy (basically broken) and will hopefully be fixed in the upcoming update!

 

 

 

Last seen on 05:41, 23. Apr 2018
Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You seem to know what you're…
Wed, 04/11/2018 - 03:23

You seem to know what you're talking about, maybe you can help me. I have done exactly as described above for a very simple GUI. It has one output slot and one Button. The slot inherits from the block and the GUI is bound to the block as well (before the GUI editor screen). The button has one event: Place a gold ingot into the output slot. Well it works... until I go to click to move it into the player inventory. I even shift-clicked it and that CRASHED the game. I looked at the crash report and it said:

The validated object is null
    at org.apache.commons.lang3.Validate.notNull(Validate.java:225)
    at org.apache.commons.lang3.Validate.notNull(Validate.java:206)
    at net.minecraft.util.NonNullList.set(NonNullList.java:56)
    at net.minecraft.tileentity.TileEntityLockableLoot.setInventorySlotContents(TileEntityLockableLoot.java:147)
    at net.minecraft.inventory.Slot.putStack(Slot.java:97)
    at mod.mcreator.mcreator_testGUI$GuiContainerMod.transferStackInSlot(mcreator_testGUI.java:160)
    at net.minecraft.inventory.Container.slotClick(Container.java:271)

You see, in the GUI mod code there is a method called transferStackInSlot which tests: 

    if (slot != null && slot.getHasStack()) {
                ItemStack itemstack1 = slot.getStack();
                itemstack = itemstack1.copy();

I can't say for sure if this is the error because I don't think there are breakpoints in this IDE for me to break on or any exception catching capabilities, so I can't inspect while debugging. 

 

So don't know wtf I'm supposed to do, I have a somewhat ambitious idea for a mod (pack) but I have been completely blocked by this since MCreator 1.7.6. 

 

I have left a few comments and emails here and there, but can't seem to get anywhere. A little help would be greatly appreciated!