#how to make an auction house?

1 messages · Page 1 of 1 (latest)

ashen field
#

I've been wanting to add an auction house for part of my custom commands. All the current auction houses I know of are behind a paywall. It wouldn't matter if it's a chest like gui or just basic forms.

I'm not sure where to start and I'm not good enough at databases, would preffer tags or scoreboards to save stuff in? Idk

Anyone have a good direction and what I should do?

Would I make an unkillable entity to tag and add scores too and keeps all the data, then just update it depending on the tags it has on it every couple of seconds? My issue would be keeping the correct data or nbt with enchants etc, so maybe throwing the stuff into a chest and updating often? - tag the player if they grab the item and then it could remove and ask if they want to purchase? I'm assuming I would have to add info the item when placed into the chest...

#

Getting the players sell price etc would be something else... maybe detect the next players typed number to label a price to the item?

#

I could use lore to help keep saved items?

#
  • maybe copy the item listed by a player into a single chest and pull from it when needed
pearl locust
#

I’ve been working on this issue for some time. Some person hired me to include it in an addon. Anyway it’s not an easy job, as there are a lot of things to consider.
First step however is database. You don’t need to make your own, go on GitHub and find some good onde. Note: reverse engineering it will allow you to update it if it breaks in the next updates and customise it to your needs.

#

Once you’ve got your database working it’s all forms (chest ui is a nightmare if you don’t already know it)

#

You will have to consider many scenarios, and ways people could cheat to grab stuff for free. Good news is that this new version of the api gives you a few more tools (than the previous) for this task

ashen field
#

ofc im sure until we have the nbt data options we are limited

pearl locust
# ashen field good to know thanks for your reply, so your saying a database can save nbt data...

Well, you have two options: new version of api lets you get almost all relevant properties of an items: enchantments, name, durability... you can just destroy the item saving all these properties, and then create a new item with these same properties (which will hence be the same as the other).
Otherwise, I used an entity database. Entities have inventory. You can transfer the item to these inventories, and then move it back from there. Some auction houses even create a custom (invisible) entity that follows the player, the agents or idk how was it called...

#

Ofc the entity database uses custom unkillable and invisible entities

ashen field
#

awe okay so using an entity to save the data

#

very interesting

#

i feel like im a ways out before i can feel good enough to create an auction house

#

i know know to get logic to work, but knowing how to do the items will be a little confusing

#

i haven't worked with items inside inventorys much yet so im already at a setback

#

😄

pearl locust
ashen field
pearl locust
ashen field
#

i have learned javascript just through minecraft bedrocks api... so im still a very early learner

#

but im pretty good at updating packs

pearl locust
ashen field
#

true, do you know of any auction house that sorta works that is out?

pearl locust
#

Uhm, no xD, sry. But I’m sure you’ll find some on GitHub

ashen field
#

or just some people have made already in bedrock

pearl locust
pearl locust
#

You might search the word “auction” in this very server. I’m sure you’d find a lot of useful info

ashen field
#

probably only in the old api

#

i will keep trying, i already have tried searching for something but didn't seem to have anything complete

#

well, i might have found something but hopfully there is a download lol'

pearl locust
#

Nice!

#

Well... if there’s so few of them out there I’ll consider publishing mine too ig (altho I have to update it and finis a few things)

ashen field
pearl locust
#

Damn

ashen field
#

thx for giving me suggestions

pearl locust
#

Np 👍

raven valley
#

seems easy

#

youd def have to log all of the players info as an object tho

#

so if a player buys there item while they're offline it would just add onto the object