Today we are bringing you the damage
command and new display entities.
Damage safely!
damage
command for applying damage to entities--pidFile
argument to dedicated server command line for printing process id to fileentity_dismount
with a vibration frequency of 6entity_mount
with a vibration frequency of 7execute summon
to allow customization of a newly spawned entityThree new entities have been added for flexible display of items, blocks and text
marker
, don't tick and have no collisions or physicsTag contents for those entities include some new data types with complex structure. Any form can be used for modifying data, but only one form is used for saving.
axis
- 3d vectorangle
- in radiansArbitrary affine transform
translation
- 3d vectorleft_rotation
, right_rotation
- rotation
scale
- 3d vectortranslation
, left_rotation
, scale
, right_rotation
Some properties of display entites can be interpolated. That means that clients will see gradual changes over time instead of instantenous jumps.
Display entities keep track of current and previous values of interpolated values:
interpolation_start
(game time, in ticks)-1
to load current game time instead)interpolation_start
+ interpolation_duration
(in ticks)Every entity in family has the following fields:
transformation
- transformation
applied to model (after normal entity orientation). Defaults to identity. Interpolatedbillboard
- option to control if entity should pivot to face player when rendered:fixed
- no rotation (default)vertical
- entity can pivot around vertical axishorizontal
- entity can pivot around horizontal axiscenter
- entity can pivot around center pointbrightness
- if present, overrides light values used for rendering. Omited by default (which means rendering uses values from entity position). Object has two fields:sky
- value of skylight, 0..15block
- value of block light, 0..15view_range
- maximum view range of this entity. Actual distance depends on client-side render distance and entity distance scalling. Default value 1.0 (roughly the same as fireball)shadow_radius
- size of shadow. Defaults to 0 (no shadow). Interpolatedshadow_strength
- strength of the shadow. Controls the opacity of the shadow as a function of distance to block below. Defaults to 1. Interpolatedwidth
, height
- describe size of culling bounding box. Bounding box spans vertically y
to y+height
and horizontally width/2
in all directions from entity position. If either field is set to 0, culling is disabled. Both default to 0glow_color_override
- override glow border color. Defaults to 0 (use team color)Displays a single item stack.
inventory.0
Fields:
item
- item stack to display. Same format as in inventory (example: {id: "minecraft:dirt", Count: 1}
)item_display
- describes item model transform applied to item (as defined in display
section in model JSON)none
(default), thirdperson_lefthand
, thirdperson_righthand
, firstperson_lefthand
, firstperson_righthand
, head
, gui
, ground
, fixed
Displays a block state.
Fields:
block_state
- block state to display. Same format as item held by endermen (example {Name:"minecraft:dirt"}
)Displays a text component.
Fields:
text
- text to display. Components are resolved with the context of the display entityline_width
- line width used to split lines (note: new line can be also addded with \n
characters). Defaults to 200text_opacity
- opacity (alpha component) of rendered text. Defaults to 255. Interpolatedbackground
- color of background. Includes alpha channel. Defaults to 0x40000000. Interpolateddefault_background
- if true, rendering uses default text background color (same as in chat). Defaults to falseshadow
- should text be displayed with shadow. Defaults to falsesee_through
- should text be visible through blocks. Defaults to falsealignment
- how text should be alignedcenter
(default), left
, right
Note: text display backgrounds uses new shader types rendertype_text_background
and rendertype_text_background_see_through
Damage Types are a new registry that can be extended through data packs. A Damage Type determines how damage is handled by the game. This includes which attributes the damage has as well as which death message is used when an entity dies due to that type of damage.
Example:
{
"exhaustion": 0.1,
"message_id": "arrow",
"scaling": "when_caused_by_living_non_player"
}
Fields:
message_id
: The message id used for deaths caused by this damage typeexhaustion
: The amount of hunger exhaustion caused by this damage typescaling
: Whether this damage type scales with difficulty levels. Possible values:never
: Damage is always the samealways
: Damage always scales with difficultywhen_caused_by_living_non_player
: Damage scales with difficulty if it was caused by a living entity who is not a playereffects
: Optional field controlling how damage manifests when inflicted on players. Possible values:hurt
(default): the default hurt soundthorns
: Thorns hurt sounddrowning
: Drowning soundburning
: A single tick of burning soundpoking
: Berry bush poke soundfreezing
: Freeze tick sounddeath_message_type
: Optional field that controls if special death message variants are used. Possible values:default
(default): No special death message logic is appliedfall_variants
: Show a variant of fall damage death instead of a regular death message, e.g. death.fell.assist.item
intentional_game_design
: Show the intentional game design message instead of a regular death messageDamage type tags control many aspects of how damage from different sources are interpreted.
New command to apply damage to entities.
Syntax:
damage <target> <amount> [<damageType>] [at <location>]
damage <target> <amount> [<damageType>] [by <entity>] [from <cause>]
Parameters:
target
: The entity to damageamount
: Amount of damage to inflictdamageType
: The type of damage to inflictentity
: The entity inflicting the damagecause
: The cause of the damage, in the case of indirect damageentity
is the Arrow projectile while cause
might be a Skeletonlocation
: The location the damage originated at (when no entity caused the damage)location
might represent the location of a Bed exploding in the NetherNew execute
sub-command for summoning new entity and binding context (@s
) to it. Meant to simplify entity setup and reduce need for raw NBT editing.
execute summon <entity id>
The following fields have been removed from damage type predicates: is_projectile
, is_explosion
, bypasses_armor
,
bypasses_invulnerability
, bypasses_magic
, is_fire
, is_magic
, is_lightning
.
A new tags
array has been added. Each entry has two fields:
id
: The ID of a damage type tagexpected
: Whether the damage is expected to have or not have the tag for the predicate to matchdoVinesSpread
game rule, determining if vines will spread to nearby blockstrue