---English version---
_____________________________________________________________________________________________________________________
I've introduced an online shopping feature to Minecraft.
A scoreboard called "balance" tracks users' balances, and if they have sufficient funds, they can purchase items online, anywhere in the world, at any time.
However, this system does not allow users in the world to freely sell items; only users with OP privileges (e.g., server administrators) can sell items.
Also, when I say "selling," it doesn't mean that items move from one place to another like in the real world; rather, items are created out of the void, and items never go out of stock, no matter how many users buy them.
Also, the money paid by users does not transfer to the OP user.
In other words, this is a transaction that is completed solely on the buyer's side, with no benefits or disadvantages for users selling items.
Creating a Form
1. Users with OP privileges can launch a form for creating a shopping form by right-clicking while holding a book in their right hand.
First, you must specify four pieces of information: the "item to invoke the shopping form (details below)," "header name," "currency name," and "number of items to sell."
Once you've completed the above steps, press the "Next" button.
You will then be taken to the next form.
*The header name is the name you give to the shopping form; by default, it is set to Online Shop.
*The currency name is the name of the unit of currency used when shopping on that form (i.e., the value registered in the scoreboard named "balance").
In short, it's the equivalent of yen or dollars.
The default name is "G".
*Regarding the number of each type of item you're selling, for example, if you want to sell four items - Netherite Sword, Netherite Axe, Netherite Pickaxe, and Netherite Shovel - the number should be 4.
②In the form you'll be redirected to, specify the item name, item ID, and price of the item you want to sell.
Once you've completed the above steps, press the "Create a form" button.
If there are no problems with the information you entered, the form will be created successfully, and users will be able to actually purchase items on that form.
The form information you create will be retained even if you reload the add-on.
*When entering the name of an item, it's recommended that you enter the price as well as the name.
For example, if you want to sell a Netherite Sword, you would enter "Netherite Sword 1000G."
If you don't enter this, users using the shopping form won't know the price per item.
*Please be careful not to make typos when entering the item ID.
If you make a mistake, you won't be able to create the form and will have to re-enter everything, which can be quite a hassle.
Also, when looking up item IDs, I think an add-on I created previously called "Convenient Functions" will be very useful, so please feel free to use it if you'd like.
Initializing a Form
Right-clicking while holding gunpowder in your right hand will initialize the form you created.
Purchasing an Item
1. The user can launch the shopping form created by the OP by right-clicking while holding the item specified by the OP in their right hand.
2. Clicking the button with the name of the item they want to purchase will take them to the quantity selection screen.
3. On this screen, they can specify the number of items they want to purchase.
Once they're done, they press the button labeled "Go to Payment Screen."
4. This will launch a confirmation screen listing the name of the item they want to purchase, the quantity, and the total price.
Press the "Pay" button to complete the purchase of the item.
*The item specified by the OP is the one specified by the OP when creating the shopping form, and by default is emeralds.
When creating the form, there is an option called "Item to call up shopping form".
If another user has the item corresponding to the ID entered there, they can launch the shopping form by right-clicking.
---日本語版---
_____________________________________________________________________________________________________________________
マイクラ内にネットショッピング機能を導入しました。
balanceという名前のscoreboardでユーザー達の残高を管理し、ユーザー達は十分な残高があればワールド内のどこにいてもいつでもオンラインで、売られているアイテムを購入する事が出来ます。
ただし、ワールド内のユーザーが自由にアイテムを売れるような代物ではなく、OP権限を持ったユーザー(つまりサーバーの管理者等)のみが商品を売る事が可能です。
また、商品を売ると言っても現実世界のように商品がとある場所から別の場所に移動するというわけではなく無からアイテムが生み出されるという感じであり、ユーザーがいくらそのアイテムを買ったところで品切れになる事はありません。
また、ユーザーが支払ったお金がOP権限を持つユーザーのところに移動するわけでもありません。
つまり、これは購入者側だけで完結してしまうものであり、商品を売り出す側のユーザーにはなんのメリットもデメリットもありません。
フォームの作成
①OP権限を持ったユーザーは、本を右手に持った状態で右クリックすると、ショッピングフォームを作成するためのフォームを起動する事が出来ます。
まず最初に、「ショッピングフォームを呼び出すためのアイテム(詳細は後述)」「ヘッダー名」「通貨の名称」「売り出す商品の種類の数」の4つの情報を指定します。
以上の作業が完了したら、「次へ」というボタンを押します。
そうすると、次のフォームに遷移します。
※ヘッダー名とはショッピングフォームに付ける名前の事で、デフォルトではOnline Shopになっています。
※通貨の名称というのは、そのフォームで買い物をする時に使う通貨(つまりbalanceという名前のscoreboardに登録されている値)の単位の名前の事です。
要するに、円やドルに相当する概念です。
デフォルトではGという名前になっています。
※売り出す商品の種類の個数についてですが、例えばネザライトの剣、ネザライトの斧、ネザライトのツルハシ、ネザライトのシャベルの4種類を売りたい場合は4になります。
②遷移先のフォームでは、実際に売り出すアイテムの名前、アイテムのID、価格を指定します。
以上の作業が完了したら、「フォームを作成」というボタンを押します。
入力内容に全く問題がなければ、無事にフォームの作成が完了し、ユーザー達がそのフォームで実際にアイテムを購入出来るようになります。
作成したフォームの情報は、アドオンを再読み込みしても維持されます。
※アイテムの名前を入力する際は、名前だけでなくアイテムの価格も入力しておく事をオススメします。
例えば、ネザライトの剣を売りたい場合は「ネザライトの剣 1000G」と入力すればいいわけです。
これを入力しておかないと、ショッピングフォームを利用するユーザーはそのアイテム1個あたりの価格を知る事が出来ません。
※アイテムのIDを入力する際はタイプミスに十分お気をつけください。
入力を誤るとフォームの作成が出来ず、全て入力し直しになってしまい、かなり面倒です。
また、アイテムのIDを調べる際は、私が以前作った「便利機能」という名前のアドオンが大変役に立つと思いますので、もしよければご利用ください。
フォームの初期化
火薬を右手に持った状態で右クリックすると、作成したフォームを初期化する事が出来ます。
アイテムの購入
①ユーザーは、OPが指定したアイテムを右手に持った状態で右クリックすると、OPが作成したショッピングフォームを起動する事が出来ます。
②購入したいアイテムの名前が書かれたボタンをクリックすると個数指定画面に移動します。
③この画面ではアイテムを購入する数を指定します。
それが出来たら「決済画面へ」と書かれたボタンを押します。
④そうすると、購入する商品の名称、購入する数、合計金額が記載された確認画面が起動します。
そこで「支払う」というボタンを押せば、アイテムの購入が完了します。
※OPが指定したアイテムというのは、OPがショッピングフォームを作成する際に指定するものであり、デフォルトではエメラルドになっています。
フォーム作成の際、「ショッピングフォームを呼び出すアイテム」という項目があるのですが、そこに入力されたIDに対応するアイテムを他のユーザーが持ち右クリックをする事によってショッピングフォームを起動出来ます。