Skip to content

Commit b2a9404

Browse files
committed
Light trail and star, code restructure, ignore fall
Added light trail and spin trail when using light flight, also added animated light start particle in player position Hid the light staff (actually called spear) when flying Improved fall damage ignore when moon jump and exit light flight Restructured code to use state system Added no gravity state to player for smoother light flight Fixed A lot more assets: - Light spin trail particle - Light trail particle - Light star particle Updated and fixed the draw line and spawn line utility functions Added PI to math general utilities
1 parent 544e887 commit b2a9404

File tree

13 files changed

+527
-59
lines changed

13 files changed

+527
-59
lines changed
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
{
2+
"format_version": "1.26.0",
3+
"minecraft:entity": {
4+
"description": {
5+
"identifier": "minecraft:player",
6+
"is_summonable": false,
7+
"is_spawnable": false,
8+
"spawn_category": "creature"
9+
},
10+
"components": {
11+
"minecraft:collision_box": {
12+
"height": 1.8,
13+
"width": 0.6
14+
},
15+
"minecraft:physics": {
16+
"push_towards_closest_space": true
17+
},
18+
"minecraft:pushable": {
19+
"is_pushable": false,
20+
"is_pushable_by_piston": true
21+
},
22+
"minecraft:can_climb": {},
23+
"minecraft:block_climber": {},
24+
"minecraft:movement": {
25+
"value": 0.1
26+
},
27+
"minecraft:attack": {
28+
"damage": 1
29+
},
30+
"minecraft:breathable": {
31+
"generates_bubbles": false,
32+
"inhale_time": 3.75,
33+
"suffocate_time": -1,
34+
"total_supply": 15
35+
},
36+
37+
"minecraft:conditional_bandwidth_optimization": {},
38+
"minecraft:environment_sensor": {
39+
"triggers": {
40+
"event": "minecraft:gain_raid_omen",
41+
"filters": {
42+
"all_of": [
43+
{
44+
"subject": "self",
45+
"test": "has_mob_effect",
46+
"value": "bad_omen"
47+
},
48+
{
49+
"subject": "self",
50+
"test": "is_in_village",
51+
"value": true
52+
}
53+
]
54+
}
55+
}
56+
},
57+
"minecraft:exhaustion_values": {
58+
"sprint": 0.1,
59+
"jump": 0.05,
60+
"attack": 0.1,
61+
"damage": 0.1,
62+
"heal": 6.0,
63+
"lunge": 4.0,
64+
"sprint_jump": 0.2,
65+
"mine": 0.005,
66+
"swim": 0.01,
67+
"walk": 0.0
68+
},
69+
"minecraft:hurt_on_condition": {
70+
"damage_conditions": [
71+
{
72+
"cause": "lava",
73+
"damage_per_tick": 4,
74+
"filters": {
75+
"operator": "==",
76+
"test": "in_lava",
77+
"subject": "self",
78+
"value": true
79+
}
80+
}
81+
]
82+
},
83+
"minecraft:insomnia": {
84+
"days_until_insomnia": 3
85+
},
86+
"minecraft:is_hidden_when_invisible": {},
87+
"minecraft:loot": {
88+
"table": "loot_tables/empty.json"
89+
},
90+
"minecraft:nameable": {
91+
"allow_name_tag_renaming": false,
92+
"always_show": true
93+
},
94+
"minecraft:player.exhaustion": {
95+
"max": 20,
96+
"value": 0
97+
},
98+
"minecraft:player.experience": {
99+
"max": 1,
100+
"value": 0
101+
},
102+
"minecraft:player.level": {
103+
"max": 24791,
104+
"value": 0
105+
},
106+
"minecraft:player.saturation": {
107+
"max": 20,
108+
"value": 5
109+
},
110+
111+
"minecraft:rideable": {
112+
"family_types": ["parrot_tame"],
113+
"pull_in_entities": true,
114+
"seat_count": 2,
115+
"seats": [
116+
{
117+
"lock_rider_rotation": 0,
118+
"min_rider_count": 0,
119+
"max_rider_count": 0,
120+
"position": [0.4, -0.2, -0.1]
121+
},
122+
{
123+
"lock_rider_rotation": 0,
124+
"min_rider_count": 1,
125+
"max_rider_count": 2,
126+
"position": [-0.4, -0.2, -0.1]
127+
}
128+
]
129+
},
130+
"minecraft:type_family": {
131+
"family": ["player"]
132+
}
133+
},
134+
"component_groups": {
135+
"whynot:static_player": {
136+
"minecraft:physics": {
137+
"has_gravity": false,
138+
"push_towards_closest_space": false
139+
}
140+
},
141+
"whynot:regular_player": {
142+
"minecraft:physics": {
143+
"has_gravity": true,
144+
"push_towards_closest_space": true
145+
}
146+
},
147+
"minecraft:add_raid_omen": {
148+
"minecraft:spell_effects": {
149+
"add_effects": [
150+
{
151+
"display_on_screen_animation": true,
152+
"duration": 30,
153+
"effect": "raid_omen"
154+
}
155+
],
156+
"remove_effects": "bad_omen"
157+
},
158+
"minecraft:timer": {
159+
"looping": false,
160+
"time": [0.0, 0.0],
161+
"time_down_event": {
162+
"event": "minecraft:clear_add_raid_omen",
163+
"target": "self"
164+
}
165+
}
166+
},
167+
"minecraft:clear_raid_omen_spell_effect": {
168+
"minecraft:spell_effects": {}
169+
},
170+
"minecraft:raid_trigger": {
171+
"minecraft:raid_trigger": {
172+
"triggered_event": {
173+
"event": "minecraft:remove_raid_trigger",
174+
"target": "self"
175+
}
176+
}
177+
}
178+
},
179+
"events": {
180+
"whynot:add_static_player": {
181+
"add": {"component_groups": ["whynot:static_player"]},
182+
"remove": {"component_groups": ["whynot:regular_player"]}
183+
},
184+
"whynot:remove_static_player": {
185+
"add": {"component_groups": ["whynot:regular_player"]},
186+
"remove": {"component_groups": ["whynot:static_player"]}
187+
},
188+
"minecraft:clear_add_raid_omen": {
189+
"add": {
190+
"component_groups": ["minecraft:clear_raid_omen_spell_effect"]
191+
},
192+
"remove": {
193+
"component_groups": ["minecraft:add_raid_omen"]
194+
}
195+
},
196+
"minecraft:remove_raid_trigger": {
197+
"remove": {
198+
"component_groups": ["minecraft:raid_trigger"]
199+
}
200+
},
201+
"minecraft:gain_raid_omen": {
202+
"add": {
203+
"component_groups": ["minecraft:add_raid_omen"]
204+
}
205+
},
206+
"minecraft:trigger_raid": {
207+
"add": {
208+
"component_groups": ["minecraft:raid_trigger"]
209+
}
210+
}
211+
}
212+
}
213+
}

resource_packs/whynot/animations/attachables/light.animation.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
"position": [0.5, 22.5, -0.5]
1919
}
2020
}
21-
}
21+
},
22+
"animation.light.hide": {
23+
"loop": true,
24+
"bones": {
25+
"root_item": {
26+
"scale": [0, 0, 0]
27+
}
28+
}
29+
}
2230
}
2331
}

resource_packs/whynot/attachables/light.attachable.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
},
1616
"animations": {
1717
"first_person_hold": "animation.light.first_person_hold",
18-
"third_person_hold": "animation.light.third_person_hold"
18+
"third_person_hold": "animation.light.third_person_hold",
19+
"hide": "animation.light.hide"
1920
},
2021
"scripts": {
2122
"animate": [
2223
{"first_person_hold": "c.is_first_person"},
23-
{"third_person_hold": "!c.is_first_person"}
24+
{"third_person_hold": "!c.is_first_person"},
25+
{"hide": "query.is_invisible"}
2426
]
2527
}
2628
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"format_version": "1.21.50",
3+
"particle_effect": {
4+
"description": {
5+
"identifier": "whynot:light_spin_trail",
6+
"basic_render_parameters": {
7+
"material": "particles_add",
8+
"texture": "textures/particle/light_trail"
9+
}
10+
},
11+
"components": {
12+
"minecraft:emitter_initialization": {
13+
"creation_expression": "variable.direction;variable.length;variable.thickness;"
14+
},
15+
"minecraft:emitter_rate_instant": {
16+
"num_particles": 1
17+
},
18+
"minecraft:emitter_lifetime_once": {
19+
"active_time": 0.5
20+
},
21+
"minecraft:emitter_shape_point": {},
22+
"minecraft:particle_lifetime_expression": {
23+
"max_lifetime": 0.5
24+
},
25+
"minecraft:particle_initial_speed": 0,
26+
"minecraft:particle_motion_dynamic": {},
27+
"minecraft:particle_appearance_billboard": {
28+
"size": ["variable.length", "variable.thickness"],
29+
"facing_camera_mode": "lookat_direction",
30+
"direction": {
31+
"mode": "custom",
32+
"custom_direction": ["variable.direction.x", "variable.direction.y", "variable.direction.z"]
33+
},
34+
"uv": {
35+
"texture_width": 1,
36+
"texture_height": 6,
37+
"uv": [0, 0],
38+
"uv_size": [1, 6]
39+
}
40+
}
41+
}
42+
}
43+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"format_version": "1.10.0",
3+
"particle_effect": {
4+
"description": {
5+
"identifier": "whynot:light_star",
6+
"basic_render_parameters": {
7+
"material": "particles_add",
8+
"texture": "textures/particle/light_star"
9+
}
10+
},
11+
"components": {
12+
"minecraft:emitter_rate_instant": {
13+
"num_particles": 1
14+
},
15+
"minecraft:emitter_lifetime_once": {
16+
"active_time": 0.08
17+
},
18+
"minecraft:emitter_shape_point": {},
19+
"minecraft:particle_lifetime_expression": {
20+
"max_lifetime": 0.05
21+
},
22+
"minecraft:particle_appearance_billboard": {
23+
"size": ["variable.size", "variable.size"],
24+
"facing_camera_mode": "rotate_xyz",
25+
"uv": {
26+
"texture_width": 480,
27+
"texture_height": 96,
28+
"uv": ["variable.frame * 96", 0],
29+
"uv_size": [96, 96]
30+
}
31+
}
32+
}
33+
}
34+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"format_version": "1.21.50",
3+
"particle_effect": {
4+
"description": {
5+
"identifier": "whynot:light_trail",
6+
"basic_render_parameters": {
7+
"material": "particles_add",
8+
"texture": "textures/particle/light_trail"
9+
}
10+
},
11+
"components": {
12+
"minecraft:emitter_initialization": {
13+
"creation_expression": "variable.direction;variable.length;variable.thickness;"
14+
},
15+
"minecraft:emitter_rate_instant": {
16+
"num_particles": 1
17+
},
18+
"minecraft:emitter_lifetime_once": {
19+
"active_time": 0.08
20+
},
21+
"minecraft:emitter_shape_point": {},
22+
"minecraft:particle_lifetime_expression": {
23+
"max_lifetime": 0.05
24+
},
25+
"minecraft:particle_initial_speed": 0,
26+
"minecraft:particle_motion_dynamic": {},
27+
"minecraft:particle_appearance_billboard": {
28+
"size": ["variable.length", "variable.thickness"],
29+
"facing_camera_mode": "lookat_direction",
30+
"direction": {
31+
"mode": "custom",
32+
"custom_direction": ["variable.direction.x", "variable.direction.y", "variable.direction.z"]
33+
},
34+
"uv": {
35+
"texture_width": 1,
36+
"texture_height": 6,
37+
"uv": [0, 0],
38+
"uv_size": [1, 6]
39+
}
40+
}
41+
}
42+
}
43+
}

resource_packs/whynot/particles/line.particle.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"identifier": "whynot:line",
66
"basic_render_parameters": {
77
"material": "particles_blend",
8-
"texture": "textures/white"
8+
"texture": "textures/entity/attachable/light"
99
}
1010
},
1111
"components": {

resource_packs/whynot/particles/moon_jump.particle.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"direction": [0, -1, 0]
2020
},
2121
"minecraft:particle_lifetime_expression": {
22-
"max_lifetime": "16 / 20.0"
22+
"max_lifetime": "7 / 20.0"
2323
},
2424
"minecraft:particle_initial_speed": 2,
2525
"minecraft:particle_motion_dynamic": {},
@@ -34,7 +34,7 @@
3434
"size_UV": [32, 32],
3535
"step_UV": [0, 32],
3636
"frames_per_second": 8,
37-
"max_frame": 16,
37+
"max_frame": 7,
3838
"stretch_to_lifetime": true
3939
}
4040
}
20.5 KB
Loading
145 Bytes
Loading

0 commit comments

Comments
 (0)