BedHome
  • 🌟Welcome to BedHome Plugin
  • Plugin usage
    • ⚙️First Install
    • 🪟GUI Formatting
    • 💭Messages Formatting
    • 🗣️Commands And Permissions
Powered by GitBook
On this page
  • Introduction
  • GUI Configuration
  • Item Types
  • Using PLAYER_HEAD and customModelData
  • Example Configurations
  • MiniMessage Formatting
  • Conclusion
  1. Plugin usage

GUI Formatting

Welcome to the BedHome plugin GUI formatting guide! In this guide, you'll learn how to customize the graphical user interface (GUI) for your BedHome plugin, enhancing the user experience for your Minecraft server players.

Introduction

The GUI in your BedHome plugin allows players to manage their homes conveniently. By configuring the GUI settings, you can control the appearance and functionality of different slots within the interface. Let's dive into the details of GUI configuration.

GUI Configuration

In your plugin's config.yml file, you'll find a section dedicated to GUI settings. Here, you can set the GUI title, size, and customize individual items within the GUI. The following options are available:

  • guiTitle: Set the title of the GUI displayed to players.

  • guiSize: Choose the GUI size from 1 to 6, representing 9 to 54 slots. Use 0 for automatic adjustment.

  • items: Configure different item types within the GUI.

Item Types

The GUI items are categorized into several types:

  1. availableSlot: Represents a slot without a location assigned.

    • Available variables:

      • {player}: Displays the player's name.

      • {slot}: Displays the slot number.

  2. occupiedSlot: Represents a slot with an assigned location.

    • Available variables:

      • {player}: Displays the player's name.

      • {slot}: Displays the slot number.

      • {x}, {y}, {z}: Displays the coordinates of the assigned location.

      • {world}: Displays the world name of the assigned location.

  3. purchaseSlot: Represents a slot available for purchase.

    • Available variables:

      • {player}: Displays the player's name.

      • {slot}: Displays the slot number.

      • {price}: Displays the price for the slot.

  4. placeholderSlot: Placeholder item.

  5. errorSlot: Represents an error condition.

    • Available variables:

      • {player}: Displays the player's name.

      • {error}: Displays an error message.

Each item type can be customized with its own material, display name, lore, and additional attributes.

Using PLAYER_HEAD and customModelData

PLAYER_HEAD

To use a custom player head as an item, set the material to PLAYER_HEAD and provide a base64-encoded texture URL under the texture attribute. Example:

yamlCopy codeoccupiedSlot:
  material: PLAYER_HEAD
  texture: '...'  # Base64-encoded texture URL
  displayName: '<gray>Slot <green>{slot}'
  lore:
    - '<gray>'
    - '<gray>X: &e{x}<gray>, Y: &e{y}<gray>, Z: &e{z}'
    - '<gray>World: &a{world}'
    - '<gray>'
    - '&e&n(LMB)<gray> Teleport to this bed'
    - '&e&n(Drop Button)<gray> Reset location of this bed'

customModelData

To assign a custom model data value to an item, use the customModelData attribute. Example:

yamlCopy codepurchaseSlot:
  material: PAPER
  customModelData: '1542'
  displayName: '<red>Slot {slot}'
  lore:
    - '<gray>'
    - '<gray>Buy this slot for &a&n{price}$'
    - '<gray>'
    - '&e(Click) <gray>To buy this slot'

Example Configurations

1.

gui:
  guiTitle: '<red>Homes'
  guiSize: 0
  items:
    availableSlot:
      material: RED_BED
      displayName: '&eSlot {slot}'
      lore:
        - '<red>'
        - '<green>(Click) <gray>Set location to this bed.'
    occupiedSlot:
      material: GREEN_BED
      displayName: '&aSlot {slot}'
      lore:
        - '<gray>'
        - '<gray>X: &e{x}<gray>, Y: &e{y}<gray>, Z: &e{z}'
        - '<gray>World: &a{world}'
        - '<gray>'
        - '&e&n(LMB)<gray> Teleport to this bed'
        - '&e&n(Drop Button)<gray> Reset location of this bed'
    purchaseSlot:
      material: GRAY_BED
      displayName: '<red>Slot {slot}'
      lore:
        - '<gray>'
        - '<gray>Buy this slot for &a&n{price}$'
        - '<gray>'
        - '&e(Click) <gray>To buy this slot'
    placeholderSlot:
      material: BLACK_STAINED_GLASS_PANE
      displayName: '<gray>'
    errorSlot:
      material: BARRIER
      displayName: '<red>{error}'

2.

gui:
  guiTitle: '<red>Homes'
  guiSize: 0
  items:
    availableSlot:
      material: RED_STAINED_BLASS_PANE
      displayName: '&eSlot {slot}'
      lore:
        - '<red>'
        - '<green>(Click) <gray>Set location to this bed.'
    occupiedSlot:
      material: GREEN_STAINED_GLASS_PANE
      displayName: '&aSlot {slot}'
      lore:
        - '<gray>'
        - '<gray>X: &e{x}<gray>, Y: &e{y}<gray>, Z: &e{z}'
        - '<gray>World: &a{world}'
        - '<gray>'
        - '&e&n(LMB)<gray> Teleport to this bed'
        - '&e&n(Drop Button)<gray> Reset location of this bed'
    purchaseSlot:
      material: YELLOW_STAINED_GLASS_PANE
      displayName: '<red>Slot {slot}'
      lore:
        - '<gray>'
        - '<gray>Buy this slot for &a&n{price}$'
        - '<gray>'
        - '&e(Click) <gray>To buy this slot'
    placeholderSlot:
      material: BLACK_STAINED_GLASS_PANE
      displayName: '<gray>'

MiniMessage Formatting

You can utilize MiniMessage formatting for rich text effects in messages. MiniMessage supports gradients, rainbow effects, and HEX colors, making your GUI messages more engaging.

Conclusion

With the knowledge gained from this guide, you can now confidently configure your BedHome plugin GUI to create a visually appealing and user-friendly experience for your players.

Feel free to experiment with different configurations to match your server's style and preferences. Happy customizing!

PreviousFirst InstallNextMessages Formatting

Last updated 1 year ago

For more detailed MiniMessage formatting options, check the official guide .

🪟
here