Date: 2020/01/25 18:14:49 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
highvelocityhurting:
type: world
events:
on player walks:
# Definitions
- define world:<player.location.world.name>
- define velocityflag:<player.flag[velocity]>
- define velocityx:<[velocityflag].x>
- define velocityx2:<[velocityx].round_to[3]>
- define velocityy:<[velocityflag].y.mul[0.37]>
- define velocityy2:<[velocityy].round_to[3]>
- define velocityz:<[velocityflag].z>
- define velocityz2:<[velocityz].round_to[3]>
- define velocity:<[velocityx]>,<[velocityy]>,<[velocityz]>,<[world]>
- define velocityAdditions:<[velocityx].add[<[velocityy].add[<[velocityz]>]>]>
- define velocityTotal:<[velocityx].add[<[velocityy].add[<[velocityz]>]>].abs>
# Speed references:
# < > Walking: 0.367 (x/z)
# ^ v Three blocks fall: 0.614 (y)
# << >> Running: 0.477 (x/z)
# ^ v 30 blocks fall: 1.825 (y)
# Knockback 5: 1.XXX for x,y,z
# Sprint and jump: 0.6XX
# Formula for damage:
# If kb 5 should be 3.5 damage (1.XXX) and v = velocity:
# v*3.5
# But, checking if the velocity total is higher than 1
# Define damage and entities near
- define damage:<[velocitytotal].mul[3.5]>
- define entities:<player.location.find.entities.within[1.18].exclude[<player>].filter[is_living]>
# Actual script:
- if <[velocitytotal]> >= 1 && <[entities].size> > 0:
- hurt <[entities]> <[damage]> source:<player>
- hurt <player> <[damage]> source:<player.location.find.entities.within[1.08].first||<player>>
#-Test Messages-#
#- actionbar targets:<player> "<[velocity]>"
#- actionbar targets:<player> "<[velocityy2]>"
#- actionbar targets:<player> "<[velocityx2]>"
#- actionbar targets:<player> "<[velocityz2]>"
#- actionbar targets:<player> "<[velocitytotal]>"
#- actionbar targets:<player> "<[entities].size>"
#- if <[velocitytotal]> >= 1.05:
# - actionbar targets:<player> "<&4>High <[velocitytotal]>"
#- else:
# - actionbar targets:<player> "<&b>Low <[velocitytotal]>"