# Easter Egg

## How to create Easter Egg <a href="#how-to-create-reward" id="how-to-create-reward"></a>

There are two options how to create EasterEgg. By in-game **UI** or **Manually** in the confiuration file. Both have some restrictions, so if you want use some advanced methods you will need to use combination of them.

### **Using in-game UI**

I recommend to watch SettingUp Tutorial to EggHunt.

{% embed url="<https://www.youtube.com/watch?v=YSCtwGplwdk>" %}

{% hint style="info" %}
To open **SetUp UI** type `/Easter SetUp`
{% endhint %}

{% hint style="info" %}
To open **Settings UI** type `/Easter Settings`
{% endhint %}

### **Manually in the file**

Configuration file `EasterEgg.yml` is located at main folder of Egghunt plugin.

#### **Template for the one Easter Egg**

```yaml
EGG_1:
  Name:
    EN: Unicorn Egg
  Description:
    EN: Unicorn
  Hint:
    EN: []
  Rarity: EPIC
  Icon:
    Material: MONSTER_EGG
    MaterialData: 55
    CustomModelData: 0
    Enchantment: false
    Color: 255:255:255
    ItemFlags:
    - HIDE_ENCHANTS
    - HIDE_ATTRIBUTES
  Condition:
    DateTimeRange:
      Active: false
      Start: 01.04.2023 00:00
      End: 02.04.2023 00:00
  Reward:
    List:
    - RewardKey_1
    ChoiceType: QUICK__ALL
  VisibilityZone: 5
  Requirement:
    CollectedEgg:
      Count: 1
  Particle:
    Active: true
    TickDelay: 13
    Data:
      Effect: SPELL_WITCH
      Amount: 35
```

### Explanation of variables

#### Name, Description and Hint support multi-localization

```yaml
Name:
  EN: "Unicorn Egg"
  SK: "Vajíčko Jednorožca"
```

#### Rarity

Rarity is not recommended to use, but you can differ what egg has higher value. Also you can create requirements using Rarity. (E.g. Collect 3 EPIC Eggs.)

If you want to change rarity names of create more/less rarities. Edit `CustomValue.yml` , `GUI.yml` and `Localization` file.

#### Icon

Setting up icon is recommended through in-game UI. It is used at Album, Locations and Admin UI for better recognition between each other eggs.

#### Condition

To increase rarity and also activity on your server, you can place a condition when is able to find Easter Egg. Players have to visit server and find egg in specified date-time range. Before and after this range, Egg won't be able to find.&#x20;

#### Requirements

Before finding that egg, player has to meet requirements. If player meets requiremenets, egg is spawned at location. You can combine these three requirements as you wish.

Examples:

Player has to find specified Egg.

```yaml
Requirement:
  CollectedEgg:
    Key: "EGG_1" #Key of the egg.
```

Player has to find at least one Egg.

```yaml
Requirement:
  CollectedEgg:
    Count: 1
```

Player has to find at least 2 eggs from COMMON rarity and one EPIC.

```yaml
Requirement:
  CollectedEgg:
    RarityCount:
    - "COMMON:2"
    - "EPIC"
```

#### VisibilityZone

How near(in blocks) has to be player to spawn egg.

```yaml
VisibilityZone: 20
```

#### Particle

Particles are spawning around the spawned Easter Egg. You can keep them active or disable them. Also you can change Effect, Color, Speed and Amount.

```yaml
Particle:
  Active: true
  TickDelay: 13 #How fast particles are spawned. (20 ticks = 1 second)
  Data:
    Effect: SPELL_WITCH
    Amount: 35
    Speed: 1.0 #Optional, Default 1.0
    Color: "255:255:255" #Optional, Default White
    Offest: #Optional, Offset from EasterEgg's location. (Vector)
      X: .5
      Y: .5
      Z: .5
```

#### Reward

Choice Types:

* QUICK\_ALL - All assigned rewards are given to player
* QUICK\_CHANCE - One reward is selected from assigned list by probability

Example for **probability**. `DiamondTools` has 90% chance, `MoneyPocket` has 10% chance to win.&#x20;

{% hint style="danger" %}
Summary of probability at assinged rewards has to be **100.0**! Otherwise, system won't work correctly!
{% endhint %}

```yaml
Reward:
  List:
  - DiamondTools:90.0
  - MoneyPocket:10.0
  ChoiceType: QUICK_CHANCE
```

### Testing the Easter Egg

At **detail** of the Easter Egg, at **bottom** of the UI, there is a `Redstone Dust`. By click on it, you can **test** the claiming. All Rewards assigned to this egg will be given to you. (No Database query/update will be executed.)

{% hint style="info" %}
Available through **Settings** and **Easter Egg Repository**.
{% endhint %}

## Finally

After successful setting up of the eggs, you need to reload the plugin to load new rewards.

{% hint style="info" %}
To reload the whole plugin type `/EggHunt Reload`
{% endhint %}
