#i need help with barrel gui thing

1 messages · Page 1 of 1 (latest)

safe notch
#

pls help

candid larkBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 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
#
⚠️ You already have a question open!

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

safe notch
#

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

lunar storm
#

What do you not understand specifically?

safe notch
#

all of it really only tells you where to put stuff

#

it doesnt really try to explain anything

lunar storm
#

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

safe notch
#

well i dont understand it they need to dumb it down for my stupid brain

#

i dont get it

lunar storm
#

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

lunar storm
#

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

safe notch
#

im saying everything in side them confuse me

lunar storm
#

Can you give me a more specific example? A part of an explanation on something.

safe notch
#

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

lunar storm
#

In the setup tab, starting from "Advancement", explains how to trigger it.

safe notch
#

wheres the barrel tho

lunar storm
safe notch
#

how would i do that

#

tho

lunar storm
#

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.

safe notch
#

none of this makes sense to me :>

#

im use to crafting recipes functions and scoreboards

lunar storm
safe notch
#

all of it :<

lunar storm
#

Ok, first the spawn egg (I'll don't talk about custom textures for now)

#

You can make any spawn egg spawn any entity

safe notch
#

ik about custom textures

#

ive done it before

lunar storm
safe notch
#

k

#

isnt a barrel not an entity

lunar storm
lunar storm
#

a barrel is a full block

safe notch
#

so how would i make it spawn a barrel

#

im getting ahead aint i

lunar storm
#

For that we use an advancement to detect when a player places one of the custom blocks

safe notch
#

so how would i code this

lunar storm
#

I'm making an example rn

safe notch
#

k thx

lunar storm
#

btw what version are you on?

safe notch
#

1.20.4

lunar storm
#
{
    "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>"
    }
}
safe notch
#

im guessing advancement

lunar storm
#

The trigger of this advancement only activates if you interact with a block

#

(placing the spawn egg down)

safe notch
#

k

lunar storm
#

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.

safe notch
#

ok so know what does the function do that it rewards

lunar storm
#

In the example, I only used a placeholder name but the function that it calls should do 3 things.

  1. execute at @e[type=item_display,tag=new] run setblock barrel ~ ~ ~
  2. execute as @e[type=item_display,tag=new] run tag @s remove new
  3. advancement 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.

safe notch
#

ok

#

is that it?

#

also im getting an error with barrel ~ ~ ~

lunar storm
#

I think I switched the coordinates and the block up

safe notch
#

k

lunar storm
#

do the coordinates first then the block

safe notch
#

you did

#

ok is that it?

lunar storm
#

That's it for the spawning part

safe notch
#

k

#

what is the spawning part suppouse to do?

#

just so i know if theres an error or not

lunar storm
#

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.

safe notch
#

wheres the displays position?

lunar storm
safe notch
#

so the display position would be in me?

lunar storm
#

no

#

The red part executes the setblock command AT the display entity

safe notch
#

whats the display entity

lunar storm
#

minecraft:item_display

safe notch
#

?

#

i have no idea what item_display is

lunar storm
#

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.

safe notch
#

ok

lunar storm
#

You can take a look in the wiki to get all the information on them, if you need

feral cryptBOT
#
**📖 Minecraft Wiki**

Contains information about everything minecraft, including datapacking related features!

Link: https://minecraft.wiki/

lunar storm
#

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

safe notch
#

k bye

safe notch
#

yo sup

lunar storm
#

Sure

safe notch
lunar storm
#

What's next?

safe notch
#

we were talking about item displays idk

lunar storm
#

Do you understand what the item display is now?

safe notch
#

yes

#

kind of

lunar storm
#

Do you also understand the spawn egg that we use to spawn the custom block?

safe notch
#

it was the bat one correct

#

do i need to do a command to get a custom one

lunar storm
safe notch
#

a bat spawn egg is fine

lunar storm
#

You can use a give command or a loot table

safe notch
#

give command is fine

lunar storm
#

You can easily generate the command for it with mcstacker

feral cryptBOT
#
**📖 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/

safe notch
#

ok what should i put in there

lunar storm
#

Go to give command an select the bat spawn egg in the item field

safe notch
#

i did

lunar storm
#

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

safe notch
#

ah ok

#

it needs to spawn a barrel correct

lunar storm
#

the barrel is a block. That part comes later.

safe notch
#

ok

#

so what does it spawn

lunar storm
#

For now, you have to select item_display

safe notch
#

i dont see item_display

#

on the list

#

ah nvm

#

i see it

lunar storm
#

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.

safe notch
#

done

#

is that it?

lunar storm
#

That and the thing from yesterday, yeah. That's how you place your custom block.

safe notch
#

is that a advancement?

#

its spawning an entity

#

but its not spawning a barrel

safe notch
safe notch
lunar storm
#

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.

safe notch
#

so

#

is it suppouse to spawn a barrel

lunar storm
#

Form the advancement on the following messages explain how to set up the function that places the barrel block

safe notch
#

k

#

tell me

lunar storm
#

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

safe notch
#

i already got the function

lunar storm
safe notch
#

so why isnt it working

#

the barrel isnt spawning

lunar storm
#

Idk, I have no knowledge on how you datapack looks, or on any error messages.

#

What does the log say?

feral cryptBOT
#
:information_source: Default Launcher Logs

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:

  1. Enable logs in the Minecraft Launcher
  2. Start your game (or restart it if you already have an open instance)
  3. Enjoy spotting errors getting much easier!
safe notch
#

let me relog

lunar storm
#

we also have this

safe notch
#

well

#

how do u get that

#

im not getting any errors

lunar storm
#

paste your dp in this channel

#

(.zip)

safe notch
#

k

candid larkBOT
#
Result of analysis

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.
safe notch
#

what

#

there is pack.mcemeta

#

there is data

#

there is minecraft

lunar storm
#

You have to zip those files, not the folder where they're in

safe notch
#

oh ok

candid larkBOT
#
Result of analysis

I found no issues with the structure of your datapack.

safe notch
#

knew it

candid larkBOT
# candid lark <@&1201956957406109788>

<@&935561184806060073> <@&1202694677766348840>

**🙇 Helpers Arise!**

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)

fathom river
#

What do you need?

safe notch
#

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

fathom river
#

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

safe notch
#

hes not really helping me fix the code

fathom river
#

Well I don't really know where you've left off nor what code needs fixing.

safe notch
#

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

fathom river
#

Ok, and what's the specific issue?

safe notch
#

its spawning the entity from the egg but the barrel isnt spawning so its most likely the function

fathom river
#

Have you tried running the function from chat?

safe notch
#

let me check

#

it worked

fathom river
#

Ok, so the issue is probably the advancement

#

Did you make it with Misode?

safe notch
#

no

fathom river
#

Start there

safe notch
#

i used the code he gave me

fathom river
#

Plug it into misode

#

To at least confirm syntax and such

safe notch
#

there are no errors

#

with misode

fathom river
#

Can you show the give command you're using for the spawn egg?

safe notch
#

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

fathom river
#

This doesn't have CustomTable:1b

safe notch
#

is it suppouse to

fathom river
#

Indeed, because your advancement is looking for Bat Spawn Egg with that NBT

#

Put it before the display

#

With a comma after, of course

safe notch
fathom river
#

Why this that a different command than the previous one?

safe notch
#

it is?

fathom river
#

Yes, it's missing the display field

safe notch
#

there

fathom river
safe notch
#

so is this correct

#

it gives me an error

#

idk what you mean by that\

fathom river
#

What error?

safe notch
#

well i put it in a command block bc it didnt fit in chat

fathom river
#

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.

safe notch
#

mc stacker is doing it wrong

fathom river
#

All you need to do is, right after the {, put CustomTable:1b,

safe notch
#

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

fathom river
#

Mcstacker is not incorrect, you just don't understand what you're asking it to do

safe notch
#

this is mcstackers 🤦‍♂️

fathom river
safe notch
#

i generated it purely with mcstacker

#

not my fault

fathom river
fathom river
safe notch
#

how can it be user error if i didnt touch it

fathom river
#

...

#

Moving on, do as I instructed

fathom river
safe notch
#

ok done

fathom river
#

Show me

safe notch
#

but know it doesnt give me it

fathom river
#

show

safe notch
#

/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

fathom river
#

Alright, what's the error? Is this still in a command block?

safe notch
#

there is no error

#

it just doesnt give me it

fathom river
#

I asked two questions

#

Please answer the second one.

safe notch
#

nvm

#

player was not found it was bc it was i did @s

fathom river
#

Yeah

#

Because command block

#

Btw you messed up the item display's Tags, so you may need to fix those for later.

safe notch
#

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

fathom river
#

Looks like it

safe notch
fathom river
#

No

outer vale
safe notch
#

its not evening doing the barrel spawn thingy when i do the command manually

safe notch
#

its not really resolved

#

but ill resolve it

candid larkBOT
#
Question Closed

Your question, #1218727734444818484 (i need help with barrel gui thing), was resolved!

Original Message

#1218727734444818484 message

Duration open

2d18h

candid larkBOT
#
🗑️ Recycling Thread

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.