Date: 2023/03/16 09:16:52 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
dice_pot2:
type: item
material: flower_pot
display name: Pot with Dices2
lore:
- This is pot with some dices inside
- Simple Dice Game
allow in material recipes: false
dice_pot_games_list:
type: data
games:
- Simple Dice Game
- Pig Dice Game
- One more
- And one more
dice_pot_world2:
debug: true
type: world
events:
on player right clicks entity with:dice_pot2:
- ratelimit <player> 1s
- narrate "click on player"
- determine cancelled
on player right clicks air with:dice_pot2:
- ratelimit <player> 1s
- define tmp:<player.item_in_hand.lore.get[1].after[- ]>
- define num:<script[dice_pot_games_list].data_key[games].find_match[<[tmp]>]>
- define num:++
- if <[num]> > <script[dice_pot_games_list].data_key[games].size>:
- define lore:<script[dice_pot_games_list].data_key[games].get[1]>
- inventory adjust slot:hand "lore:- <[lore]>"
- narrate "You select <player.item_in_hand.lore.get[1].after[- ]> to play"
- else:
- define lore:<script[dice_pot_games_list].data_key[games].get[<[num]>]>
- inventory adjust slot:hand "lore:- <[lore]>"
- narrate "You select <player.item_in_hand.lore.get[1].after[- ]> to play"
- if <player.item_in_hand.lore.get[1].after[- ].contains_match[*Pig*]>:
- narrate test
on player right clicks !*air with:dice_pot2:
- determine cancelled