#i need help with barrel gui thing
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D
Open question: #1217988055949119489
so
what i have questions is how would i trigger the barrel opening also not to mention i dont understand any of what the forum explained
What do you not understand specifically?
all of it really only tells you where to put stuff
it doesnt really try to explain anything
It explains every thing
Where to put what and what it does
If there is a part that needs more explaining, then tell me but it's hard to explain something in more detail, if I don't know what it is
well i dont understand it they need to dumb it down for my stupid brain
i dont get it
Can you give me an example for what to dumb down?
If I change the guide I want to know how to make it better understandable
Those are the different parts of the system but If they confuse you, you can ignore them, all the important stuff is in the guide itself explained
im saying everything in side them confuse me
Can you give me a more specific example? A part of an explanation on something.
the code it gives me confuses me
i would like to know what it does
so i can learn how to do it for future refrences
also not to mention
i dont know how i would trigger this
In the setup tab, starting from "Advancement", explains how to trigger it.
wheres the barrel tho
I do it with a retextured spawn egg that spawns an item display with a tag called "new". I use a similar advancement as in the guide to detect when a player uses the spawn egg. The triggered function then places the barrel at the position of the item display with the new tag. Then it removes the new tag.
none of this makes sense to me :>
im use to crafting recipes functions and scoreboards
The advancement or the spawn egg?
all of it :<
Ok, first the spawn egg (I'll don't talk about custom textures for now)
You can make any spawn egg spawn any entity
We use that to spawn the custom model of the custom gui blocck
The item display will also act as the controller for all the gui's functionality
no, it is not a block entity
a barrel is a full block
For that we use an advancement to detect when a player places one of the custom blocks
so how would i code this
I'm making an example rn
k thx
btw what version are you on?
1.20.4
{
"criteria": {
"requirement": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"player": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:bat_spawn_egg"
],
"nbt": "{CustomTable:1b}"
}
}
],
"location": []
}
}
},
"rewards": {
"function": "<namespace>:<function name>"
}
}
im guessing advancement
The trigger of this advancement only activates if you interact with a block
(placing the spawn egg down)
k
It also has conditions that check if the item used is a bat spawn egg with the CustomTable::1b nbt
If all of this is true, then it gives the player a reward
in this case the reward is a function that gets executed as and at the player.
ok so know what does the function do that it rewards
In the example, I only used a placeholder name but the function that it calls should do 3 things.
execute at @e[type=item_display,tag=new] run setblock barrel ~ ~ ~execute as @e[type=item_display,tag=new] run tag @s remove newadvancement revoke @s only <namespace>:<advancement name>
in this order.
wait
now
it places the block at the new item display, removes the new tag to not interfere with other new gui blocks, and reactivate advancement for the player.
I think I switched the coordinates and the block up
k
do the coordinates first then the block
That's it for the spawning part
k
what is the spawning part suppouse to do?
just so i know if theres an error or not
The spawning part is solely for spawning the display entity (as custom texture and controller for the block) and placing the barrel at the displays position.
wheres the displays position?
so the display position would be in me?
whats the display entity
minecraft:item_display
an item display is an entity that they added to minecraft with the only purpose to be used in datapacks
it can display items with various transformations applied. It can even interpolate between those transformations.
ok
You can take a look in the wiki to get all the information on them, if you need
Contains information about everything minecraft, including datapacking related features!
Link: https://minecraft.wiki/
We can continue this tomorrow. I'll go to bed now. It's 3:30 am for me rn
and I'm awake since 7:30
I'm tired
k bye
yo sup
yo can we pick this up
Sure

What's next?
we were talking about item displays idk
Do you understand what the item display is now?
Do you also understand the spawn egg that we use to spawn the custom block?
I used a bat spawn egg in my example, but you can use any other too
Yes
a bat spawn egg is fine
You can use a give command or a loot table
give command is fine
You can easily generate the command for it with mcstacker
Allows you to generate lots of different types of commands! Especially useful for long /give commands for items with custom names and lore and other things of the like.
Link: https://mcstacker.net/
ok what should i put in there
Go to give command an select the bat spawn egg in the item field
i did
The blue part is the nbt for the item and the red part is for the entity that the egg spawns
And here you can change the entity that the egg spawns
the barrel is a block. That part comes later.
For now, you have to select item_display
The empty text field, that says filter, is like a search field. It will limit the selection of entries.
In the item display nbt, you only have to set a few things.
The red part is for when you have a custom model for the block. You can put the item with custom model data in there. If you don't have one, leave it blank.
The blue part needs to have 0.5 in all 3 fields. It offsets the model from the entity's origin so, that the origin is in the model's center.
The green part is for scaling the model. If you have a custom model, set it to something like 1.0001 to prevent z-fighting.
Also very important is this field. There you put all its custom tags. In your case, you would need one for identifying that entity as a Custom block controller and as a new entity. Just write custom_gui, new in that field for now.
That and the thing from yesterday, yeah. That's how you place your custom block.
is it suppouse to
helo
Yeah, that's an advanceemnt
The spawn egg spawns the controller entity for the custom block.
The advancement detects when you spawn that controller entity, and then runs a function that places the barrel at the controllers position.
Form the advancement on the following messages explain how to set up the function that places the barrel block
Everything you need to know for the beginning is already in this help post.
I'm not copy-pasting the whole chat history because you don't want to scroll up a few messages
i already got the function
if thats what ur asking
Then you already have everything
Idk, I have no knowledge on how you datapack looks, or on any error messages.
What does the log say?
The logs are where Minecraft displays errors when something goes wrong and can thus help you gain information about why something isn't working for you!
To open the logs:
- Enable logs in the Minecraft Launcher
- Start your game (or restart it if you already have an open instance)
- Enjoy spotting errors getting much easier!
let me relog
we also have this
I found 3 issues with the structure of your datapack.
- I couldn't find
pack.mcmeta. Make sure that it exists in the root of the zip. - I couldn't find the folder
data. Make sure that it exists in the root of the zip. - I couldn't find the namespace
minecraft. It isn't required, but 90% of datpacks do need to have it. If you don't use tick/load functions or you don't need to change vanilla data, then disregard this.
You have to zip those files, not the folder where they're in
I found no issues with the structure of your datapack.
knew it
<@&935561184806060073> <@&1202694677766348840>
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
What do you need?
well this code aint workin
and he hasnt been really helpful
you want the code?
i might as well start fresh
so what i really need is that to make a custom gui
thing
with the spawner
thing
and i dont know what really to do
I'm afraid I don't have a lot of personal experience with making a custom GUI altogether. I may be able to help identify a specific issue if you know where the fault is, but otherwise I would trust HeDeAn more, especially with all the resources and guidance they've provided you thus far
hes not really helping me fix the code
Well I don't really know where you've left off nor what code needs fixing.
let me show
code
advancemnt: { "criteria": { "requirement": { "trigger": "minecraft:item_used_on_block", "conditions": { "player": [ { "condition": "minecraft:match_tool", "predicate": { "items": [ "minecraft:bat_spawn_egg" ], "nbt": "{CustomTable:1b}" } } ], "location": [] } } }, "rewards": { "function": "duckie:placeholder" } }
function: execute at @e[type=item_display,tag=new] run setblock ~ ~ ~ barrel execute as @e[type=item_display,tag=new] run tag @s remove new advancement revoke @s only duckie:open_gui
Ok, and what's the specific issue?
its spawning the entity from the egg but the barrel isnt spawning so its most likely the function
Have you tried running the function from chat?
no
Start there
i used the code he gave me
Can you show the give command you're using for the spawn egg?
yes
/give @p bat_spawn_egg{display:{Name:'{"text":"Custom Egg"}'},EntityTag:{id:"minecraft:item_display",Tags:["custom_gui","new"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[.5f,.5f,.5f],scale:[1f,1f,1f]}}} 1
This doesn't have CustomTable:1b
is it suppouse to
Indeed, because your advancement is looking for Bat Spawn Egg with that NBT
Put it before the display
With a comma after, of course
/give @s bat_spawn_egg[nbt=CustomTable:1b], {display:{Name:'{"text":"Custom Egg"}'},EntityTag:{id:"minecraft:item_display",Tags:["custom_gui","new"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[.5f,.5f,.5f],scale:[1f,1f,1f]}}} 1
where do i put it
in this
Why this that a different command than the previous one?
it is?
Yes, it's missing the display field
there
Ok, so yeah I already told you where
What error?
well i put it in a command block bc it didnt fit in chat
Wait did you edit this with your current command? That's like fully wrong, wth
I don't even know where to begin. You're trying to write it like a component but you're clearly not in the latest snapshots, so you're too early. Even if you were, that's not a component.
mc stacker is doing it wrong
All you need to do is, right after the {, put CustomTable:1b,
wanna see mcstackers version
/give @s[nbt=CustomTable:1b] bat_spawn_egg{display:{Name:'{"text":"Custom Egg"}'},EntityTag:{id:"minecraft:item_display",Tags:["custo","_gui"," new"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[.5f,.5f,.5f],scale:[1f,1f,1f]}}} 1
You're doing it wrong
Mcstacker is not incorrect, you just don't understand what you're asking it to do
this is mcstackers 🤦♂️
Mcstacker is not necessary to make this adjustment
I know, that's why I am saying it is not wrong, it's user error
Do this not in Mcstacker
how can it be user error if i didnt touch it
Specifically, make that adjustment to this version of the command
ok done
Show me
but know it doesnt give me it
show
/give @s minecraft:bat_spawn_egg{CustomTable:1b, display:{Name:'{"text":"Custom Egg"}'},EntityTag:{id:"minecraft:item_display",Tags:["custo","_gui"," new"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[.5f,.5f,.5f],scale:[1f,1f,1f]}}} 1
Alright, what's the error? Is this still in a command block?
Yeah
Because command block
Btw you messed up the item display's Tags, so you may need to fix those for later.
dang
/give @a minecraft:bat_spawn_egg{CustomTable:1b, display:{Name:'{"text":"Custom Egg"}'},EntityTag:{id:"minecraft:item_display",Tags:["custom_gui"," new"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[.5f,.5f,.5f],scale:[1f,1f,1f]}}} 1
did i fix the tags
Looks like it
do you have any more ideas cause its still not working
No
wdym by not working exactly
its not evening doing the barrel spawn thingy when i do the command manually
Your question, #1218727734444818484 (i need help with barrel gui thing), was resolved!
#1218727734444818484 message
2d18h
This thread has been inactive for some time, so I'm going to archive it.
If you're still using the thread, just send a message and it'll pop back on the thread list.