GUI text entry to create an item via ID

Started by Where_didIcome_from on Fri, 10/09/2020 - 17:23

Topic category: Help with MCreator software

Last seen on 18:39, 4. Nov 2020
Joined Sep 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
GUI text entry to create an item via ID
Fri, 10/09/2020 - 17:23

Hi! I'm trying to create a GUI that will use a custom item in an input slot and a text entry field to create another item in the 2nd slot based on the previously mentioned text entry field. Basically, you enter an item ID, put 32 of x item into slot 0, and click a button to convert said 32 items into whatever item that corresponds to the ID you have set, dropping it into slot 1. Problem is, I can't figure out how to program it to use the input field as an item entry. I saw a small thread with the same problem, https://mcreator.net/forum/65422/gui-textfield but I can't find the block mentioned in it anywhere, let alone where it's said to be in the thread. Does anyone know how I can execute this?

Last seen on 06:06, 24. Nov 2020
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
As of now what you are…
Mon, 10/12/2020 - 02:36

As of now what you are trying to achieve is not possible at this current update. I have no further opinions on this matter. Thank you.

Last seen on 11:10, 23. Nov 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Actually, I think you should…
Mon, 10/12/2020 - 13:45

Actually, I think you should be able to do this. I don't know what the "Get block by namespace" block from the other forum is talking about, but I think that you could use an "execute store" commands to get this done. I'll try this out and post a picture of the procedure I come up with.

Last seen on 11:10, 23. Nov 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Alright, I have a procedure:…
Mon, 10/12/2020 - 14:23

Alright, I have a procedure:

https://drive.google.com/file/d/13YgzZgsb52nWyIuDJV8PLENx_O8kqog3/view?usp=sharing

Some notes:

  • This actually uses the data merge command, not the execute store command
  • Rounding the xyz position is necessary because otherwise it would have a decimal and Minecraft doesn't like that
  • It's important that all the text blocks are pretty much exactly as they are shown, so here there are in order. Make sure you get all the text inside the " "
    • "data merge block "
    • " " (there's a space in here)
    • " "
    • " {Items:[{Slot:1b, id:""
    • "", Count:"
    • "b}]}"
  • For my GUI, the input slot had an id of 0 and the output slot had an id of 1. If you gave the output slot a different value, you'll need to change the underlined 1 above to that new id.
  • This can allow you to get stacks of normally unstackable items, but it's pretty overpowered anyways so... watch out for that?

Hope this does what you want.