Date: 2020/01/01 20:29:47 UTC-08: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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
mayor_script:
type: world
events:
on player right clicks block with wheat:
- take iteminhand quantity:1
- drop mayor_placer <context.location>
on player right clicks block with mayor_placer:
- LocationTag.add[<context.location>]
- create player mayor <context.location.add[0,2,0]> save:mayorID
- take iteminhand quantity:1
- assignment set script:mayor_assignment npc:<entry[mayorID].created_npc>
- determine cancelled
mayor_assignment:
type: assignment
actions:
on assignment:
- trigger name:click state:true
interact scripts:
- 1 mayor_interact
mayor_interact:
type: interact
steps:
1:
click trigger:
script:
- inventory open d:in@mayor_menu
on player clicks on mayor_hire_soldier:
- chat "hired"
- determine cancelled
on player clicks on mayor_dismiss:
- chat "goodbye"
- remove mayor
- determine cancelled
mayor_placer:
type: item
material: bat_spawn_egg
display name: Mayor spawner
mayor_hire_soldier:
type: item
material: stone_sword
display name: Hire a soldier for 64 Wheat
mayor_dismiss:
type: item
material: barrier
display name: Dismiss the mayor
mayor_menu:
type: inventory
title: Mayor
size: 27
slots:
- "[] [] [] [] [] [] [] [] [i@mayor_dismiss]"
- "[] [] [] [] [] [i@mayor_hire_soldier] [] [] []"
- "[] [] [] [] [] [] [] [] []"