Skip to content

Configuration

Justin_SGD edited this page Jul 19, 2023 · 18 revisions

Setting up the inventory.yml file

The inventory.yml file is a configuration file used to control the appearance and behavior of the inventory in the plugin. Here is an explanation of how to set up the inventory.yml file and what you can configure:

The inventory.yml file contains sections for each type of inventory used by the plugin. In the example above, there are sections for "ChooseCase", "CasePreview", and "CaseAnimation".

Within each section, you can set the title, size, and number of slots to use.

You can also define the items to display in the inventories, including filler items, navigation items, and reward items.

For each item, you can define the material, display name, lore, and slot.

For navigation items, such as the "Next Page" and "Previous Page" buttons, you can also set the head values used to display the player head.

Some items also have boolean values (true or false) to control their activation.

To integrate the inventory.yml file into the plugin, simply add the sections and settings mentioned above to your existing inventory.yml file and save it. Make sure to upload the file to the correct directory in the plugin and restart the plugin for the changes to take effect.

Here is an example configuration for inventory.yml:

ChooseCase:
  Title: '&6CaseOpening'
  Size: 45
  Items:
    FillItem:
      Active: true
      Material: LIGHT_GRAY_STAINED_GLASS_PANE
      Displayname: '&6'
      Slots:
       - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 36
        - 37
        - 38
        - 39
        - 40
        - 41
        - 42
        - 43
        - 44
CasePreview:
  Title: '&bVorschau'
  Size: 45
  Items:
    CaseItems:
      MaxItemsPerPage: 27
    FillItem:
      Active: true
      Material: LIGHT_GRAY_STAINED_GLASS_PANE
      Displayname: '&6'
      Slots:
       - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 36
        - 37
        - 38
        - 39
        - 40
        - 41
        - 42
        - 43
        - 44
    NextItem:
      Material: PLAYER_HEAD
      HeadValue: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTliZjMyOTJlMTI2YTEwNWI1NGViYTcxM2FhMWIxNTJkNTQxYTFkODkzODgyOWM1NjM2NGQxNzhlZDIyYmYifX19
      Displayname: '&7» &eNächste Seite'
      Lore: []
      Slot: 44
    PreviousItem:
      Material: PLAYER_HEAD
      HeadValue: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmQ2OWUwNmU1ZGFkZmQ4NGU1ZjNkMWMyMTA2M2YyNTUzYjJmYTk0NWVlMWQ0ZDcxNTJmZGM1NDI1YmMxMmE5In19fQ==
      Displayname: '&7» &eVorherige Seite'
      Lore: []
      Slot: 36
    BackItem:
      Material: BARRIER
      Displayname: '&7» &cZurück'
      Lore: []
      Slot: 40
CaseAnimation:
  Title: '&6CaseOpening'
  Size: 27
  Items:
    FillItem:
      Active: true
      Material: BLACK_STAINED_GLASS_PANE
      Displayname: '&6'
      Slots:
       - 0
        - 1
        - 2
        - 3
        - 5
        - 6
        - 7
        - 8
        - 9
        - 17
        - 18
        - 19
        - 20
        - 21
        - 22
        - 23
        - 24
        - 25
        - 26
    WinItem:
      Active: true
      Material: HOPPER
      Displayname: '&eGewinn'
      Lore: []
      Slot: 4
    CaseItem:
      Slots:
       - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16

Explanation of cases.yml

The cases.yml file is used to define the different cases that can be obtained by players when using the JuByteCase plugin. Here is an explanation of the different sections and properties of the vote case:

  • visible: A boolean value indicating whether this case should be visible to players or not.
  • material: The material of the block that will be used to represent this case in the player's inventory.
  • headValue: The value of the player's head that will be displayed as the block texture. In this case, it is set to none.
  • displayName: The name of the case that will be displayed to players.
  • slot: The inventory slot where this case will be placed.
  • lore: A list of strings that will be used to display additional information about the case in the player's inventory. In this case, it displays the number of cases the player has and instructions on how to open and view them.
  • caseItems: A map of the different items that can be obtained when opening this case, along with their properties.
    • '1', '2', '3': The keys of each item. These can be any unique string.
    • material: The material of the item that will be obtained when opening the case.
    • headValue: The value of the player's head that will be displayed as the item texture. In this case, it is set to none.
    • displayName: The name of the item that will be displayed to players.
    • itemLore: A list of strings that will be used to display additional information about the item to players.
    • commands: A list of commands that will be executed when the item is obtained.
    • enchantments: A list of enchantments that will be applied to the item.
    • giveAsItem: A boolean value that indicates whether the item should be added to the player's inventory given as a physical item.
    • amount: The amount of the item that will be obtained.
    • glow: A boolean value indicating whether the item should have a glowing effect.
    • announce: A boolean value indicating whether the server should broadcast a message when the item is obtained.
    • chance: The chance (in percent) of obtaining this item when opening the case.
    • checkHasAlreadyPermissions: A boolean value indicating whether the plugin should check if the player has already obtained this item before.
    • checkPermissions: A list of permissions that checks if the player has that permission. If he does, he will be compensated.
    • checkHasAlreadyRanks: A boolean value indicating whether the plugin should check if the player has already obtained an rank with the same name before.
    • checkRanks: A list of things that checks if the player is in this group. If he is, he will be compensated.
    • consolationPrizeCommands: A list of commands that will be executed if the player doesn't obtain this item.

Here is an example configuration for cases.yml:

vote:
  visible: true
  material: CHEST
  headValue: 'none'
  displayName: '&6Vote'
  slot: 11
  lore:
   - '&7Du hast {case_amount} Truhe'
    - '&6'
    - '&aLinksklick &7zum Öffnen'
    - '&cRechtsklick &7zum Anschauen'
  caseItems:
    '1':
      material: DIAMOND_SWORD
      headValue: none
      displayName: '&bTest'
      itemLore: []
      commands: []
      enchantments:
       - sharpness:5
      giveAsItem: true
      amount: 1
      glow: false
      announce: false
      chance: 70
      checkHasAlreadyPermissions: false
      checkPermissions: []
      checkHasAlreadyRanks: false
      checkRanks: []
      consolationPrizeCommands: []
    '2':
      material: NETHERITE_SWORD
      headValue: none
      displayName: '&bOP'
      itemLore: []
      commands: []
      enchantments: []
      giveAsItem: true
      amount: 1
      glow: true
      announce: true
      chance: 1
      checkHasAlreadyPermissions: false
      checkPermissions: [ ]
      checkHasAlreadyRanks: false
      checkRanks: [ ]
      consolationPrizeCommands: []
    '3':
      material: DIAMOND_SWORD
      headValue: none
      displayName: '&7Test'
      itemLore:  
        - 'Test Lore'
        - '&5Second line'
      commands: 
        - say hello 
      enchantments: 
        - 'mending:1'
      giveAsItem: true
      amount: 1
      glow: false
      announce: false
      chance: 2
      checkHasAlreadyPermissions: false
      checkPermissions: 
        - 'case.use'
      checkHasAlreadyRanks: false
      checkRanks: 
        - 'Admin'
      consolationPrizeCommands: 
        - 'case add {player} vote 5'

Explanation of messages.yml

messages.yml is a YAML file commonly used in Minecraft plugins to store messages and other language-specific text used by the plugin. Here is a brief explanation of the messages contained in the file:

Prefix: '&8[&6CaseOpening&8]'
NoPerms: '{prefix} &cDazu hast du keine Rechte.'
IsntPlayer: '{prefix} &cNur Spieler können diesen Befehl ausführen.'
ReportBug: '{prefix} &4Achtung! &7Du hast einen &cFehler &7entdeckt. Bitte melde dich bei einem &bTeammitglied&7.'
NotEnoughCases: '{prefix} &7Du hast &cnicht &7genügend {caseDisplayName} &7Truhen.'
FullInventory: '{prefix} &7Dein Inventar ist &cvoll&7, weshalb du keine Kisten öffnen kannst.'
Announce: '{prefix} &7Der Spieler &e{player} &7hat {winItem} aus der {caseDisplayName} &7Truhe &agewonnen&7.'
Win: '{prefix} &7Du hast {winItem} &7aus der {caseDisplayName} &7Truhe &agewonnen&7.'
ConsolationPrizeMessage: '{prefix} Da du diesen Gewinn bereits hast, erhältst du eine Entschädigung.'
MobileCasePermission: 'case.mobile'
Command:
  Case:
    Permission: case.use
    RemoveCaseBlockPermission: case.destroy
    Usage: |-
      &f==========={prefix}&f===========
        &e/case setcaseblock
        &e/case reload
        &e/case add
        &e/case remove
        &e/case set
        &e/case get
      &f==========={prefix}&f===========
    DestroyCaseBlock: '{prefix} &7Du hast den &eCaseBlock &czerstört&7.'
    SetCaseBlock:
      Permission: case.setblock
      AlreadyExists: '{prefix} &cHier steht bereits ein &eCaseBlock&c!'
      Success: '{prefix} &aDu hast den &eCaseBlock &agesetzt.'
    Reload:
      Permission: case.reload
      Success: '{prefix} &7Du hast die &eConfig &aerfolgreich &7neugeladen.'
    Add:
      Permission: case.addcase
      Usage: '{prefix} &cNutze: &e/case add <Spieler> <Case> <Anzahl>'
      PlayerNotFound: '{prefix} &7Der Spieler &e{player} &7konnte &cnicht &7gefunden werden.'
      CaseNotFound: '{prefix} &7Die Case &e{case} &7existiert &cnicht&7.'
      IsntANumber: '{prefix} &e{amount} &7ist &ckeine &7Nummer.'
      Success: '{prefix} &7Du hast &e{player} &b{amount} {caseDisplayName} &agegeben&7.'
    Remove:
      Permission: case.removecase
      Usage: '{prefix} &cNutze: &e/case remove <Spieler> <Case> <Anzahl>'
      PlayerNotFound: '{prefix} &7Der Spieler &e{player} &7konnte &cnicht &7gefunden werden.'
      CaseNotFound: '{prefix} &7Die Case &e{case} &7existiert &cnicht&7.'
      IsntANumber: '{prefix} &e{amount} &7ist &ckeine &7Nummer.'
      Success: '{prefix} &7Du hast &e{player} &b{amount} {caseDisplayName} &centnommen&7.'
    Set:
      Permission: case.setcase
      Usage: '{prefix} &cNutze: &e/case set <Spieler> <Case> <Anzahl>'
      PlayerNotFound: '{prefix} &7Der Spieler &e{player} &7konnte &cnicht &7gefunden werden.'
      CaseNotFound: '{prefix} &7Die Case &e{case} &7existiert &cnicht&7.'
      IsntANumber: '{prefix} &e{amount} &7ist &ckeine &7Nummer.'
      Success: '{prefix} &7Du hast &e{player} &b{amount} {caseDisplayName} &agesetzt&7.'
    Get:
      Permission: case.getcase
      Usage: '{prefix} &cNutze: &e/case set <Spieler> <Case>'
      PlayerNotFound: '{prefix} &7Der Spieler &e{player} &7konnte &cnicht &7gefunden werden.'
      CaseNotFound: '{prefix} &7Die Case &e{case} &7existiert &cnicht&7.'
      PlayerCaseAmount: '{prefix} &7Der Spieler &e{player} &7hat &b{amount} {caseDisplayName} &7Truhen&7.'
    Log:
      Permission: case.getcase
      Usage: |-
        &f==========={prefix}&f===========
          &e/case log <player>
          &e/case log <player> <page>
          &e/case log <player> <case>
          &e/case log <player> <case> <page>
          &e/case log opened <case>
          &e/case log opened total
        &f==========={prefix}&f===========
      LogEntry: '  &7Case: &a{chest_name} &7Gewinn: &c{chest_award} &7Uhrzeit: &b{chest_time}'
      Pagination: ' &f- &7Seite &a{current_page}&7/&c{total_page} &f- '
      NextPage: '&eNächste Seite »'
      PreviousPage: '&e« Vorherige Seite'
      PlayerNotFound: '{prefix} &7Der Spieler &e{player} &7konnte &cnicht &7gefunden werden.'
      TotalOpenedChest: '{prefix} &7Es wurden insgesamt &e{chest_amount} &7geöffnet.'
      TotalOpenedChestByChestName: '{prefix} &7Es wurden insgesamt &a{chest_amount} {chest_name}&7Kisten geöffnet.'

Explanation of commands.yml

Commands:
  Case:
    Name: 'Case'
    Description: 'Case management'
    Aliases: ['opening']
    Active: true

This is a YAML configuration file for the JuByteCase plugin. It defines the Case command with the following properties:

  • Name: The name of the command is Case.
  • Description: A brief description of what the Case command does, which is "Case management".
  • Aliases: An array of alternate names that can be used to execute the Case command, which is set to ['opening'].
  • Active: A boolean value indicating whether the Case command is active or not, which is set to true.

This configuration file is used by the plugin to register and configure the Case command. It can be edited to modify the properties of the command or to add new commands to the plugin.

Explanation of config.yml

Here is the config.yml file in English along with its explanation for the JuByteCase GitHub Wiki:

# Whether to log the cases given and taken in the console
CaseLog: true

# The material of the cases
CaseMaterial: CHEST

# The start duration of the first animation in seconds
Delay: 0.025

# Added to all subsequent animations after the first animation in seconds
AddedDelay: 0.05

# The duration of the case animation in seconds
ChestGeneralTime: 10

# The maximum number of items in a case
MaxItems: 30

# The minimum number of items in a case
MinItems: 2

# The sound played when opening a case
ChestSound1: ENTITY_ENDER_DRAGON_FLAP

# The sound played when closing a case
ChestSound2: UI_BUTTON_CLICK

# The sound played when winning an item from a case
WinSound: ENTITY_PLAYER_LEVELUP

# A boolean that controls whether the case animation inventory stays open after the animation or not
ForceCloseChestAfterWin: false
  • CaseLog: A boolean value indicating whether to log the cases given and taken in the console.
  • CaseMaterial: The material of the cases. In this case, it is set to CHEST.
  • Delay: The start duration of the first animation in seconds
  • AddedDelay: Added to all subsequent animations after the first animation (seconds). For example: 1st animation -> 0.025, 2nd animation 0.075, 3rd -> animation 0.0125 and so on
  • ChestGeneralTime: The duration of the case animation in seconds.
  • MaxItems: The maximum number of items in a case.
  • MinItems: The minimum number of items in a case.
  • ChestSound1: The sound played when opening a case. In this case, it is set to ENTITY_ENDER_DRAGON_FLAP.
  • ChestSound2: The sound played when closing a case. In this case, it is set to UI_BUTTON_CLICK.
  • WinSound: The sound played when winning an item from a case. In this case, it is set to ENTITY_PLAYER_LEVELUP.
  • ForceCloseChestAfterWin: A boolean that controls whether the case animation inventory stays open after the animation or not. In this case, it is set to false.

Clone this wiki locally