#How to make a sell

1 messages · Page 1 of 1 (latest)

verbal vortex
#

so when you stand on top of a lest say beacon it sells all of your dirt and gives you Money

ripe roost
#

You're probably going to need to wait for custom components. With them, you can make a script trigger with the on_step_on component to clear them of dirt and adds to whatever scoreboard you're using for money based on that amount. I don't have example code for that btw, it's just an idea b

kindred nova
ripe roost
#

Ah, right. Don't know why you had to ping me though, I wasn't the one asking the question

verbal vortex
verbal vortex
ripe roost
#

It technically can be done with block events, but those will be removed soon so it is 100% not recommended and not really worth learning

#

As you'll just need to switch it over to custom components when they release from beta anyway

verbal vortex
#

With block event can I just type in the name of the scoreboard or is there something else I have to do?

ripe roost
#

There's more to block events, they're pretty similar to entity events. But again, I would recommend just waiting for custom components, or using some kind of command substitute

#

Like running something like this in tick.json: execute as @a[hasitem={item=minecraft:dirt}] at @s if block ~~-1~ beacon run function sell_dirt

#

Where sell dirt looks like this: scoreboard players add @s[hasitem={item=minecraft:dirt,quantity=64..}] money 64 clear @s[hasitem={item=minecraft:dirt,quantity=64..}] dirt 0 64 scoreboard players add @s[hasitem={item=minecraft:dirt,quantity=32..}] money 32 clear @s[hasitem={item=minecraft:dirt,quantity=32..}] dirt 0 32 scoreboard players add @s[hasitem={item=minecraft:dirt,quantity=16..}] money 16 clear @s[hasitem={item=minecraft:dirt,quantity=16..}] dirt 0 16 scoreboard players add @s[hasitem={item=minecraft:dirt,quantity=8..}] money 8 clear @s[hasitem={item=minecraft:dirt,quantity=8..}] dirt 0 8 scoreboard players add @s[hasitem={item=minecraft:dirt,quantity=4..}] money 4 clear @s[hasitem={item=minecraft:dirt,quantity=4..}] dirt 0 4 scoreboard players add @s[hasitem={item=minecraft:dirt,quantity=2..}] money 2 clear @s[hasitem={item=minecraft:dirt,quantity=2..}] dirt 0 2 scoreboard players add @s[hasitem={item=minecraft:dirt,quantity=1..}] money 1 clear @s[hasitem={item=minecraft:dirt,quantity=1..}] dirt 0 1 execute as @s[hasitem={item=minecraft:dirt}] run function sell_dirt

verbal vortex
verbal vortex
ripe roost
#

I've never used bridge, so no idea

verbal vortex
#

ok

verbal vortex
ripe roost
#

Just vscode

#

With the blockception extension for autocomplete

#

And node.js for scripting

verbal vortex
#

Are you sure that suite is even safe?

ripe roost
#

You're downloading it from with in the app, correct?

ripe roost
#

It should be safe then

verbal vortex
#

Or does it use { , : etc

ripe roost
#

The node.js is more difficult than blockception. Check out machinebuilders intro to scripting for how to download that (it's what I used)

#

Oh, I see

#

you're still editing text

#

Like, it's the actual json you're modifying

#

blockception tells you what your options are though

verbal vortex
#

Hmm would it be new friendly do you think?

ripe roost
#

Depends on the person

verbal vortex
ripe roost
#

I don't really know what experience you have beyond add-on making. A lot of it is how fast of a learner you are, which I don't know

verbal vortex
#

Oh I didn’t mean to open a em

#

Dm

verbal vortex
#

But I’m stating coding so I can make my server better

ripe roost
#

Gotcha. Yeah, you can try it if you want, or keep using bridge if you want

#

Whatever works for you

#

I'm sure there's a way to make mcfunctions with bridge; I just don't know how you would

verbal vortex
ripe roost
#

For functions you just paste them into a .mcfunction file. tick.json has a json structure htough. Here's an intro to functions and tick.json: https://wiki.bedrock.dev/commands/mcfunctions.html

verbal vortex
verbal vortex
#

@ripe roost im using vscoode but im not suure if im doing it quite right do yoou have any idea ho to start this type of code and finish it?

ripe roost
#

Like, how to do functions?

#

I can't really explain them any better than the links I sent

verbal vortex
ripe roost
#

Ah

verbal vortex
#

there is more aboce it

ripe roost
#

You just make a new function, in a .mcfunction file

#

No need for json structure

verbal vortex
#

but im sure its not right

ripe roost
#

Just type the list of commands

verbal vortex
ripe roost
#

Like, a valid mcfunction would look like this:

say hi
Tp ~~~
#

There are no presets for functions

#

You need to make a folder called functions in your bp

#

Then put the .mcfunction files in there

#

I generally create a .txt file and rename the extension to .mcfunction, as they're stored in the same way

verbal vortex
#

tthis good?

ripe roost
#

The .mcfunction isn't in the file

#

It's the file extension

verbal vortex
#

well i wouldnt say easy

ripe roost
#

Other than that, it's right

verbal vortex
#

hmm

ripe roost
#

At least if it's in the right folder

verbal vortex
#

me trying to figure out how to do that

#

so if i go into the file somehow it will work

ripe roost
#

What platform are you on? Windows, Mac linux?

verbal vortex
#

windows

ripe roost
#

As I know how to change file extensions on windows

#

Ok

verbal vortex
#

imm in luck lol

ripe roost
#

File explorer should have an option to view file extensions, which lets you change them

#

I'll send some screenshots in a second

verbal vortex
#

ok

#

wait do i go to my own files?

ripe roost
#

Yeah, just go to the file directory for your addon. It should be in com.mogang

verbal vortex
#

when i open it there is no com.mojang only minecraft and it leads me back too vscode

#

ohhh

#

i dont have com.mojang i called it minecraaft

ripe roost
#

Ok, so what you do for the file extensions is select the 3 dots at the top of file explorer. Then, go to options. Under view, one of the checkboxes should say something about hiding file extensions. Uncheck that. From there, you should be able to see the extension of files and change them to .mcfunction files

ripe roost
#

As that's the folder you need to be in

verbal vortex
#

i have iy on my desktop in my files

ripe roost
#

So like, that's the files mc is reading from?

verbal vortex
ripe roost
#

As addons should be in com.mojang, which is created automatically when mc bedrock is installed

verbal vortex
#

so should i add a file called com.mojang ?

ripe roost
#

No

#

I just don't get how your addon is updating if it's not stored there

verbal vortex
#

would it go in here?

ripe roost
#

What's that minecraft file?

verbal vortex
#

i made it myself

ripe roost
#

Also, is your addon showing up ingame?

verbal vortex
#

wait i can do that

ripe roost
#

Ohhhh, I see

#

so your addon isn't imported at all yet

#

That explains it

verbal vortex
#

oh yh im only creating it rn

ripe roost
#

Have you gone through the beginner's guide on the wiki? It talks quite a bit about creating the files and such in the first part

#

That might be helpful

verbal vortex
#

ill have a look at that and ill ask ifyu if i have any problems

ripe roost
#

Ok, sounds good

#

Once you have the addon set up in mc, add a folder to the root of the pack called "functions"

#

Then put your mcfunction files in there

verbal vortex
ripe roost
#

Add a folder?

#

Just right click in your file explorer

verbal vortex
#

ive got it in the foilder now but its not a mc addone

ripe roost
#

So, it's in the development_behavior_pack folder but isn't showing up in mc?

#

Also, the .mcfunction is still in the file; it needs to be the extension, not a part of the file

verbal vortex
#

ity only has one

verbal vortex
ripe roost
#

Wait, I thought you went through the tutorial to get your addon setup?

#

It needs to be in the folder for your addon in com.mojanf

#

There's no point doing anything with it before it's there

verbal vortex
#

the thing that im getting stuck on is to import it into minecraft

ripe roost
#

Ah, i see. You don't need to make a .Mcaddon file. Yoh just need to open the folder using the path given in the tutorial, go to the folder development_behavior_packs, and put it in there

verbal vortex
ripe roost
#

Ah, mb, for some reason I thought you had the link

verbal vortex
#

That was the one that showed how to do it

#

It only explained basic stuff but not how to link it to mc

ripe roost
#

.mcpack and .mcaddon files just add the json to those folders

verbal vortex
#

wait i dont have com.mojang t5hou

#

thou

#

though

ripe roost
#

You must be looking in the wrong place. Minecraft needs that to run

#

It's where it stores all of your worlds and other data

verbal vortex
#

wait i have the com.mojang folder now with this in it - .mcfunction sell_dirt

ripe roost
#

That doesn't go in com.mojang directly. It goes in the folder for your addon, under functions

#

Just like how the beginner guide has entities and items you put into folders under the addon's folder

verbal vortex
ripe roost
#

I'd recommend going through the full beginner's guide and get that addon working

#

I think it will help it make more sense

verbal vortex
ripe roost
#

Like, testing the addon overall? It should just show up in game if everuthing is implemented correctly

#

You might also want to check out the vanilla packs as an example

white hornetBOT
verbal vortex
ripe roost
#

Well, I said that it was mostly right except for the fact .mcfunction was in the file rather than the extension. And the function can be right with your addon still being broken

#

I meant the addon format as a whole, as the manifest might be wrong

verbal vortex
#

i got the com.mojang file in now i think im starting to understand

ripe roost
#

Nice! Have you had any success with the vanilla packs as well?

verbal vortex
ripe roost
#

Nice!

verbal vortex
#

ive fiigured out basically everything now but i just need to makee this function actualy function

ripe roost
#

All you should need to do is add it to the list of functions in tick.json. Learn more about it here: https://wiki.bedrock.dev/commands/mcfunctions.html

verbal vortex
#

What should I be adding to the tick.json

#

its says therer is something wrong with money

ripe roost
#

Can you send the full content log?

verbal vortex
#

what is the content log?

#

ooh

#

like when you goo into minecraft

#

and it shows the glitchs

#

?

white hornetBOT
verbal vortex
#

oh yes i see

ripe roost
#

So is there a money item then?

verbal vortex
#

Item well i did /scoreboard objective add money dummy

#

I did money because that was the scoreboard you used that is should give the money to

ripe roost
#

Yeah, you shouldn't need an item for that

#

Unless you don't want to use a scoreboarx

verbal vortex
#

I deleted the item pack

#

amd it still isn’t working

ripe roost
#

Can you send your tick.json?

verbal vortex
#

as in a picture of it?

#

thid is what i put in my tick.json

#

if you are wondering what firstfunction is, it is the name of my function

#

{
"values": ["firstfunction"]

}

ripe roost
#

Ah, ok. Maybe try putting a /say into firstfunction to make sure it's running