nahkd123 / stonks

Global market mod for top selling block game
https://nahkd123.github.io/stonks/
MIT License
1 stars 0 forks source link

Question: Product with custom name/components #54

Open BrewDawg12 opened 3 months ago

BrewDawg12 commented 3 months ago

I want to add it so you can sell and buy a named product

Edit: My guess is that I need to edit the stonks give command ,but don't know how with the file being binary

nahkd123 commented 3 months ago

When adding item to config file, you can use components with the format that is the same as /give command. For example: stick[item_name={"text":"Advanced stick"}] (or something else I don't remember).

So to add new product with custom name, you would add something like this under the category:

product product_id
    name Display name in menu
    construction item minecraft:stick[item_name={"text":"Advanced stick"}]

Further info can be found in https://nahkd123.github.io/stonks/References/Adapters/ItemsAdapter/. For adding products, refer to https://nahkd123.github.io/stonks/References/Services/IntegratedStonksService/.

nahkd123 commented 3 months ago

Also the Stonks' give command can be used to obtain the product that was defined in config (or provided from remote service, assuming you have another mod adding remote service to Stonks). It was originally meant for troubleshooting.

nahkd123 commented 3 months ago

If you managed to fix your issue, don't forget to close this, or if you have issue configuring the market, don't hesitate to ask here.