Skip to content

Commit

Permalink
Add TradeMart
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer authored Jul 23, 2024
1 parent a8f27c1 commit 935ebc4
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions content/addon/trade-mart/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
+++
title = "Trade Mart"
weight = 1
+++

{{% button href="https://github.com/BetterGUI-MC/TradeMart/" style="gray" icon="code" %}}Code{{% /button %}} {{% button href="https://ci.codemc.io/job/BetterGUI-MC/view/Addon/job/TradeMart/" style="green" icon="download" %}}Download{{% /button %}}

## Description

This is an addon to add Villager-like GUI for item trading.

## Format

```yaml
menu-settings:
menu-type: trade

# The actions when the player opens the menu
open-action:
- action
- action
- action
...

# The actions when the player closes the menu
close-action:
- action
- action
- action
...

# The requirement before the player can open the menu
view-requirement:
<requirement-set>
<requirement-set>
<requirement-set>
...

# The requirement before the player can close the menu
close-requirement:
<requirement-set>
<requirement-set>
<requirement-set>
...

# The permission required to open the menu
permission: bettergui.test

# The command to open the menu
command:
- command1
- command2
...

# The title of the inventory
title: <name>
#name: <name>

# The list of argument processors to process the arguments of the command to open the menu
argument-processor:
- <argument-processor>
- <argument-processor>

trade-name1:
item1:
<button-settings>
item2:
<button-settings>
result:
<button-settings>

trade-name2:
item1:
<button-settings>
item2:
<button-settings>
result:
<button-settings>
...
```

## Note

* `open-action`: the [Action]({{% ref "action/overview" %}}) when the menu is opened.
* `close-action`: the [Action]({{% ref "action/overview" %}}) when the menu is closed.
* `view-requirement`: the [Requirement]({{% ref "requirement/overview" %}}) to check before opening the menu. If it is not met, the menu will not be opened.
* `close-requirement`: the [Requirement]({{% ref "requirement/overview" %}}) to check before closing the menu. If it is not met, the menu will not be closed.
* `argument-processor`: the [Argument Processor]({{% ref "argument" %}}) to handle the arguments of the command to open the menu.

## Trade

```yaml
trade-name:
item1:
<button-settings>
item2:
<button-settings>
result:
<button-settings>
max-uses: <number>
```
* `item1`: The first item to trade. REQUIRED
* `item2`: The second item to trade. OPTIONAL
* `result`: The result item. REQUIRED
* `max-uses`: The maximum uses of a trade. OPTIONAL

## Example

```yaml
menu-settings:
menu-type: trade
title: "&c&lTest Trade"
command: trade
trade1:
item:
id: diamond
item2:
id: redstone
result:
id: piston
trade2:
item:
id: diamond_block
amount: 64
result:
id: paper
name: "&b&lRich Cerificate"
trade3:
item:
id: paper
name: "&b&lRich Cerificate"
item2:
id: emerald
amount: 64
result:
id: paper
name: "&a&lVillage Cerificate"
lore:
- ""
- "&7Signed by {player}"
```

0 comments on commit 935ebc4

Please sign in to comment.