Date: 2018/06/12 16:04:02 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
"YAML Anti-Farm Script":
type: world
debug: false
events:
on server start:
- yaml create id:antifarm-flags
on shutdown:
- yaml unload id:antifarm-flags
on entity dies:
# Check to see if entity was a player
- if <context.entity.is_player>
{
# If so, cancel all below checks
- queue clear
}
# Check to see if any timers exist on this block
- if <yaml[antifarm-flags].contains[expirations.<context.entity.location.simple>]>
# If yes, clear any old timers
{
- yaml id:antifarm-flags set expirations.<context.entity.location.simple>:<yaml[antifarm-flags].read[expirations.<context.entity.location.simple>].as_list.filter[in_seconds.is[more].than[<util.date.time.duration.in_seconds>]]>
}
# Add a timer for this mob's death
- yaml id:antifarm-flags set expirations.<context.entity.location.simple>:<list[<util.date.time.duration.add[30m]>].include[<yaml[antifarm-flags].read[expirations.<context.entity.location.simple>]||li@>]>
# Check to see whether there are too many timers on this block
- if <yaml[antifarm-flags].read[expirations.<context.entity.location.simple>].as_list.size||0> >= 3
{
# Debug messages
# - announce to_console "[DEBUG] Normal mobs YAML same location: <context.entity.location.simple>"
# - announce to_console "[DEBUG] Normal mobs YAML same location size: <yaml[antifarm-flags].read[expirations.<context.entity.location.simple>].as_list.size>"
# Cancel drops and experience
- determine NO_DROPS_OR_XP
- queue clear
}
on mm denizen death:
# Check to see if any timers exist on this block
- if <yaml[antifarm-flags].contains[expirations.<context.activemob.location.simple>]>
# If yes, clear any old timers
{
- yaml id:antifarm-flags set expirations.<context.activemob.location.simple>:<yaml[antifarm-flags].read[expirations.<context.activemob.location.simple>].as_list.filter[in_seconds.is[more].than[<util.date.time.duration.in_seconds>]]>
}
# Add a timer for this mob's death
- yaml id:antifarm-flags set expirations.<context.activemob.location.simple>:<list[<util.date.time.duration.add[30m]>].include[<yaml[antifarm-flags].read[expirations.<context.activemob.location.simple>]||li@>]>
# Check to see whether there are too many timers on this block
- if <yaml[antifarm-flags].read[expirations.<context.activemob.location.simple>].as_list.size||0> >= 3
{
# Debug messages
# - announce to_console "[DEBUG] MythicMobs YAML same location: <context.activemob.location.simple>"
# - announce to_console "[DEBUG] MythicMobs YAML same location size: <yaml[antifarm-flags].read[expirations.<context.activemob.location.simple>].as_list.size>"
# Cancel drops and experience
- determine drops:li@;money:0;exp:0
- queue clear
}
# Check for and cancel an empty gold message
on player receives message:
- if <context.message> contains "dropped 0.0 gold"
{
- determine CANCELLED
}
"YAML Anti-Spawner Script":
type: world
debug: true
events:
on server start:
- yaml create id:antispawner-flags
on shutdown:
- yaml unload id:antispawner-flags
on entity spawns:
- if <context.entity.is_player>
{
- queue clear
}
# - announce to_console "[DEBUG] context.entity.location.find.blocks[mob_spawner].within[8] is <context.entity.location.find.blocks[mob_spawner].within[8]>"
- if <context.entity.location.find.blocks[mob_spawner].within[8]> !== li@
{
- wait 1t
# - announce to_console "[DEBUG] Mob spawned within 8 blocks of spawner, reason is <context.reason>"
- yaml id:antispawner-flags set entities.spawned-by-spawner:->:<context.entity.uuid>
}
- if '<context.reason>' == 'SPAWNER'
{
- wait 1t
- yaml id:antispawner-flags set entities.spawned-by-spawner:->:<context.entity.uuid>
}
# - if '<context.reason>' == 'CUSTOM'
# {
# - wait 1t
# - yaml id:antispawner-flags set entities.spawned-by-spawner:->:<context.entity.uuid>
# }
on entity dies:
- if <context.entity.is_player>
{
- queue clear
}
- if <yaml[antispawner-flags].read[entities.spawned-by-spawner].contains[<context.entity.uuid>]>
{
# - announce to_console "[DEBUG] Normal mobs YAML spawner"
- determine NO_DROPS_OR_XP
- yaml id:antispawner-flags set entities.spawned-by-spawner:<-:<context.entity.uuid>
}
on mm denizen death:
- if <yaml[antispawner-flags].read[entities.spawned-by-spawner].contains[<context.activemob.uuid>]>
{
# - announce to_console "[DEBUG] MythicMobs YAML spawner"
- determine drops:li@;money:0;exp:0
- yaml id:antispawner-flags set entities.spawned-by-spawner:->:<context.activemob.uuid>
}