Skip to content

Commit e706d4e

Browse files
committed
Update version number and API
Updated the API with the new tasks and flags. Since display entities now support adjusting the view range I decided to rename tracking range to view range.
1 parent f44b789 commit e706d4e

1 file changed

Lines changed: 53 additions & 9 deletions

File tree

scripts/dmodels_main.dsc

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# @contributors Max^
1010
# @thanks Darwin, Max^, kalebbroo, sharklaserss - for helping with reference models, testing, ideas, etc
1111
# @date 2022/06/01
12-
# @updated 2022/12/24
12+
# @updated 2023/05/12
1313
# @denizen-build REL-1782
14-
# @script-version 1.6
14+
# @script-version 1.7
1515
#
1616
# This takes BlockBench "BBModel" files, converts them to a client-ready resource pack and Denizen internal data,
1717
# then is able to display them in minecraft and even animate them, by spawning and moving invisible armor stands with resource pack items on their heads.
@@ -55,6 +55,9 @@
5555
# /dmodels animate [animation] - "dmodels.animate" - Causes your nearest real-spawned model to play the specified animation
5656
# /dmodels stopanimate - "dmodels.stopanimate" - Causes your nearest real-spawned model to stop animating
5757
# /dmodels npcmodel [model] - "dmodels.npcmodel" - sets an NPC to render as a given model (must be loaded). Use 'none' to remove the model.
58+
# /dmodels rotate [0,0,0] - "dmodels.rotate" - Rotates the entire model to the set euler angles.
59+
# /dmodels scale [1,1,1] - "dmodels.scale" - Scales the entire model to the set scale.
60+
# /dmodels color [255,255,255] - "dmodels.color" - Sets the color of the model to the set color.
5861
#
5962
# #########
6063
#
@@ -75,6 +78,12 @@
7578
# - run dmodels_move_to_frame def.root_entity:<[root]> def.animation:idle def.timespot:0.5
7679
# # To remove a model
7780
# - run dmodels_delete def.root_entity:<[root]>
81+
# # To rotate a model
82+
# - run dmodels_set_rotation def.root_entity:<[root]> def.quaternion:<quaternion[identity]>
83+
# # To scale a model
84+
# - run dmodels_scale_model def.root_entity:<[root]> def.scale:<location[1,1,1]>
85+
# # To set the color of a model
86+
# - run dmodels_set_color def.root_entity:<[root]> def.color:<color[red]>
7887
#
7988
# #########
8089
#
@@ -92,19 +101,21 @@
92101
# list: A ListTag of valid model names, equivalent to the ones that can be input to 'dmodels_load_bbmodel'
93102
# This task should be ~waited for.
94103
# dmodels_spawn_model
95-
# Usage: Spawns a single instance of a model using real armor stand entities at a location.
104+
# Usage: Spawns a single instance of a model using real item display entities at a location.
96105
# Input definitions:
97106
# model_name: The name of the model to spawn, must already have been loaded via 'dmodels_load_bbmodel'.
98107
# location: The location to spawn the model at.
99-
# tracking_range: (OPTIONAL) can override the global tracking_range setting in the config below per-model if desired.
108+
# scale: The scale to spawn the model with.
109+
# rotation: The rotation to spawn the model with.
110+
# view_range: (OPTIONAL) can override the global view_range setting in the config below per-model if desired.
100111
# fake_to: (OPTIONAL) list of players to fake-spawn the model to. If left off, will use a real (serverside) entity spawn.
101112
# Supplies determination: EntityTag of the model root entity.
102113
# dmodels_delete
103114
# Usage: Deletes a spawned model.
104115
# Input definitions:
105116
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
106117
# dmodels_reset_model_position
107-
# Usage: Resets any animation data on a model, moving the model back to its default positioning.
118+
# Usage: Updates the model's position, rotation, and scale.
108119
# Input definitions:
109120
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
110121
# dmodels_end_animation
@@ -123,6 +134,28 @@
123134
# animation: The name of the animation to play (as set in BlockBench).
124135
# timespot: The time (in seconds) from the start of the animation to select as the frame.
125136
# delay_pose: 'true' if playing fluidly to offset the pose application over time, 'false' to snap exactly to frame position.
137+
# dmodels_set_rotation:
138+
# Usage: Sets the global rotation of the model
139+
# Input definitions:
140+
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
141+
# quaternion: The quaternion to set the rotation to.
142+
# update: 'true' if the model should update it's global rotation.
143+
# dmodel_set_scale:
144+
# Usage: Sets the scale of the model
145+
# Input definitions:
146+
# root_entity: The root entity gotten from 'dmodels_spawn_model
147+
# scale: The scale to set the model to as a LocationTag <location[1,1,1]>.
148+
# update: 'true' if the model should update it's scale.
149+
# dmodels_set_color:
150+
# Usage: Sets the color of the model
151+
# Input definitions:
152+
# root_entity: The root entity gotten from 'dmodels_spawn_model
153+
# color: The color to set the model to as a ColorTag <color[red]>.'
154+
# dmodels_set_view_range:
155+
# Usage: Sets the view range of the model
156+
# Input definitions:
157+
# root_entity: The root entity gotten from 'dmodels_spawn_model
158+
# view_range: The view range of the model.
126159
# dmodels_attach_to
127160
# Usage: Attaches a model's position/rotation to an entity.
128161
# Input definitions:
@@ -137,9 +170,20 @@
137170
# 'dmodel_anim_part.<ID_HERE>': a mapping of outline IDs to the part entity spawned for them.
138171
# 'dmodels_animation_id': only if the model is animating automatically, contains the animation ID.
139172
# 'dmodels_anim_time': only if the model is animating automatically, contains the progress through the current animation as a number representing time.
173+
# 'dmodels_global_rotation' the rotation of the entire model this also affects the rotation while the model is animating.
174+
# 'dmodels_global_scale' the scale of the entire model.
175+
# 'dmodels_view_range' the view range of the model.
176+
# 'dmodels_color' the color of the model.
177+
# 'dmodels_can_teleport' determines if the root and parts of the model can teleport or not this should be used for non-moveable animated models.
140178
# 'dmodels_attached_to': the entity this model is attached to, if any.
141179
# 'dmodels_temp_alt_anim': if set to a truthy value, will tell the model to not play any auto-animations (so other scripts can indicate they need to override the default)
142-
# Additional flags are present on both the root and on parts, but are not considered API - use at your own risk.
180+
# Parts of the model have the following flags:
181+
# 'dmodel_def_part_id': the name of the part.
182+
# 'dmodel_def_can_rotate' if the part can rotate or not while playing animations.
183+
# 'dmodel_def_can_scale' if the part can scale or not while playing animations.
184+
# 'dmodel_def_pose' the default pose of the part after spawning
185+
# 'dmodel_def_offset' the relative offset of the part from the root entity's position
186+
# 'dmodel_root' returns the root entity of the part
143187
#
144188
# #########
145189
#
@@ -158,10 +202,10 @@
158202
dmodels_config:
159203
type: data
160204
debug: false
161-
# You can optionally set a tracking range for all properly-spawned model entities.
162-
# If set to 0, will use the server default for armor stands.
205+
# You can optionally set a view range for all properly-spawned model entities.
206+
# If set to 0, will use the server default for display entities.
163207
# You can instead set to a value like 16 for only short range visibility, or 128 for super long range, or any other number.
164-
tracking_range: 0
208+
view_range: 0
165209
# You can choose which item is used to override for models.
166210
# Using a leather based item is recommended to allow for dynamically recoloring items.
167211
# Leather_Horse_Armor is ideal because other leather armors make noise when equipped.

0 commit comments

Comments
 (0)