#(uncvr) Change display entity data (Scale, Rotataion)

41 messages · Page 1 of 1 (latest)

fallow hornet
#

I'm trying to make a replica of Hypixel's Giant Sword ability using display entity, how do I change properties such as rotation and scale of a display entity? Here is my script so far, but the display entity of the sword is like an item frame on the floor.

GIANT_SWORD_ABILITY:
    type: world
    debug: false
    events:
        after player right clicks block with:giants_sword:
            - define item <player.item_in_hand>
            - if <[item]> matches *air:
                - stop
            - if <player.gamemode> != creative:
                - take slot:hand
            - define location <player.eye_location.ray_trace[range=5].if_null[null]>
            - if <[location]> == null:
                - narrate "<&[error]>You can't place this block here."
                - stop
            - spawn item_display_editor_entity[item=<[item].with[quantity=1]>] <[location]> save:entity

item_display_editor_entity:
    type: entity
    debug: true
    entity_type: item_display
    mechanisms:
        item: stone
burnt badgeBOT
#

(uncvr) Change display entity data (Scale, Rotataion)

burnt badgeBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

fallow hornet
#

(btw I stole parts of another script so there is some useles code)

celest island
#

It's usually best to use the paste site so scripts are easier to read, since Discord can mess up formating a fair bit, and lose all highlighting.

#

!paste

solid bearBOT
celest island
#

scale is a mechanism of item_display entities, just like the item mechanism you're using already. You can use the adjust command on an already spawned entity to change mechanisms

#

!m EntityTag.scale

solid bearBOT
# celest island !m EntityTag.scale

(Property) A display entity's scale, represented as a !objecttype LocationTag vector.
Can be interpolated, see !language Display entity interpolation.

Group

Properties

Object

EntityTag

Input

LocationTag

Tags

<EntityTag.scale> (Property) A display entity's scale, represented as a <@link objecttype Location...

celest island
#

!c adjust

solid bearBOT
# celest island !c adjust
Group

core

Syntax

adjust [<ObjectTag>/def:<name>|...] [<mechanism>](:<value>)

Short Description

Adjusts an object's mechanism.

Description

Many object tag types contains options and properties that need to be adjusted.
Denizen employs a mechanism interface to deal with those adjustments.
To easily accomplish this, use this command with a valid object mechanism, and sometimes accompanying value.

Specify "def:<name>" as an input to adjust a definition and automatically save the result back to the definition.

You can optionally adjust a MapTag of mechanisms to values.

To adjust an item in an inventory, use !command inventory...

celest island
#

For the display being on the ground, you'll likely want to adjust the spawned entity's pitch/yaw/location. There are a LOT of tags available for LocationTag to shift positions/orientations. A helpful one for just getting something straight might be with_pose.

#

!t LocationTag.with_pose

solid bearBOT
fallow hornet
#

@celest island is it possible to change the roll of the item display? I want it go into ground more straight.

celest island
#

I'd check out the left_rotation mechanism, should be able to have full control over the item display.

Also, there's a pretty great script in the showcase that helps with creating/modifying item displays with a GUI menu. #showcase message

#

!m EntityTag.left_rotation

solid bearBOT
# celest island !m EntityTag.left_rotation

(Property) A display entity's "left" rotation.
Note that !mechanism EntityTag.right_rotation is also available, but should normally use this instead.

Group

Properties

Object

EntityTag

Input

QuaternionTag

Tags

<EntityTag.left_rotation> (Property) A display entity's "left" rotation. Note that <@link mechanis...

fallow hornet
celest island
#

When the spawn command is used with save: it'll save a reference to the spawned entity in the name you give. Then to make changes you'll want the adjust command, used with whatever mechanism you're looking to change, probably left_rotation in this case.

#

!c spawn

solid bearBOT
# celest island !c spawn
Group

entity

Syntax

spawn [<entity>|...] (<location>) (target:<entity>) (persistent) (reason:<reason>)

Short Description

Spawns a list of entities at a certain location.

Description

Spawn an entity or list of entities at the specified location.

Accepts the 'target:<entity>' argument which will cause all spawned entities to follow and attack the targeted entity.

If the persistent argument is present, the entity will not despawn when no players are within range, causing the entity to remain until killed.

Optionally specify 'reason:<reason>' (Paper only) to specify the reason an entity is spawning for the 'entity spawns' event,
using any reason from <@link url https://hub.s...

celest island
#

!c adjust

solid bearBOT
# celest island !c adjust
Group

core

Syntax

adjust [<ObjectTag>/def:<name>|...] [<mechanism>](:<value>)

Short Description

Adjusts an object's mechanism.

Description

Many object tag types contains options and properties that need to be adjusted.
Denizen employs a mechanism interface to deal with those adjustments.
To easily accomplish this, use this command with a valid object mechanism, and sometimes accompanying value.

Specify "def:<name>" as an input to adjust a definition and automatically save the result back to the definition.

You can optionally adjust a MapTag of mechanisms to values.

To adjust an item in an inventory, use !command inventory...

spice laurelBOT
#
Resolved

Thread closed as resolved.

fallow hornet
#

any other way to do this better?

spice laurelBOT
#
Thread Reopened

Thread was manually reopened by @fallow hornet.

fallow hornet
#

idk nothing about Quaternions, is there a better way to adjust the roll of an entity, cuz rn im just guessing random numbers while doing like /adjust left_rotation:0.5,0.5,0.9,0.5 until it looks good, but then the scale gets messed up

spice laurelBOT
#
Changed to Help/Support

Thread is now a Help/Support thread. A helper will check your thread when available.

willow burrow
#

!t to_axis_angle_quaternion

solid bearBOT
willow burrow
#

this is pretty useful for simple rotations

hot remnant
#

with_pitch and with_yaw would set it to taht everytime to be consistent

rotund spear
#

Feel free to ask if you need any more help, otherwise -

spice laurelBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@fallow hornet