# Luckyblocks

This is a block from which you can get various prizes. Luckyblocks are placed manually and have a cooldown. They can disappear when clicked and appear when the cooldown is over, making them suitable for only 1 player. Or they can be static.

<figure><img src="/files/vwvJFoV82FJsR1jyXBib" alt=""><figcaption><p>Default</p></figcaption></figure>

### Installation <a href="#installation" id="installation"></a>

First you need to get a lucky block. Enter the command to get the block in your hands. By default there are only 1 type. But you can create more types.

```
/luckyblock give LuckyBlock1
```

Then simply place the block where you want it to be.

### Commands <a href="#commands" id="commands"></a>

| Description                                                                                                                                                          | Command                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| View mode commands                                                                                                                                                   | /luckyblock help                                                         |
| Adds an item to your hand as a prize when you pick up a luckyblock. You need to specify the drop chance. Be sure to change the drop type in the config for this mode | /luckyblock additem <mark style="color:purple;">\<name> \<chance></mark> |
| Gives a lucky block to you                                                                                                                                           | /luckyblock give <mark style="color:purple;">\<name></mark>              |
| Removes the lucky block that the player is looking at                                                                                                                | /luckyblock remove                                                       |
| Gives a lucky block to the player                                                                                                                                    | /luckyblock give <mark style="color:purple;">\<nick> \<name></mark>      |

### Permissions <a href="#permissions" id="permissions"></a>

{% hint style="danger" %}
You **must** use a permission manager like [LuckPerms](https://luckperms.net/download) which supports `.*` permissions notation. Bukkit doesn't support this notation by default!
{% endhint %}

| For what                                                 | Permission             |
| -------------------------------------------------------- | ---------------------- |
| Gives all mode access to the player                      | fun.luckyblock.\*      |
| Gives the player permission to create/remove luckyblocks | fun.luckyblock.create  |
| Gives the player permission to set luckyblocks           | fun.luckyblock.set     |
| Gives the player permission to use luckyblocks           | fun.luckyblock.use     |
| Gives the player permission to add items to  luckyblocks | fun.luckyblock.additem |

### Main config (config.yml)

```yaml
Lucky block enable: true #If "false", this mode will not be available
Lucky block disable for creative mode: false #Can a user open a lucky block in a creative?
Lucky block break by right click: false #Will it be possible to open luckyblock not only by breaking it?
Lucky block title enable: true #Will the title be displayed when you win?
Lucky block title fade in time: 10 #In ticks
Lucky block title stay time: 40 #In ticks
Lucky block title fade out time: 10 #In ticks
Lucky block fireworks: #Victory animations. You can set 1 and more animations. Or set [] to disable
  - 'SALUT_4'
```

### Mode config (luckyblock.yml)

```yaml
LuckyBlock1:
  Name: '&6☻ &e&lLUCKY BLOCK&r &6☻'
  Lore: [ ]
  Head: 519d28a8632fa4d87ca199bbc2e88cf368dedd55747017ae34843569f7a634c5
  Head texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTE5ZDI4YTg2MzJmYTRkODdjYTE5OWJiYzJlODhjZjM2OGRlZGQ1NTc0NzAxN2FlMzQ4NDM1NjlmN2E2MzRjNSJ9fX0=
  Disappears on click: false
  Cooldown: 300
  Default particle: 'PRESENT_4'
  Usage particle: 'LUCKYBLOCK'
  Custom model data: 0
  Drops:
    - Command: eco give %player% 1000
      Chance: 100.0
  Locations: [ ] #Set by command
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shimado.gitbook.io/fungames/modes/luckyblocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
