Teleport bug with armor stands?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Jordan

Member
Jan 25, 2017
190
12
18
25
Scotland
This code will basically teleport an armor stand upwards to a certain point, the below code does it perfectly however if you changed the coordinates so they're not abslotue but relative it'll be very jittery and won't teleport at times.. not to sure what sort of bug this is

code_language.skript:
on rightclick on non-burning furnace:
    cancel event
    spawn 1 of armor stand at location 0, 100, -1 in world "world"
    add "{NoGravity:1b,Small:1,Invisible:1,Invulnerable:1,NoBasePlate:1,PersistenceRequired:1}" to nbt of last spawned entity
    set {_temp} to location 0, 100, -1 in world "world"
    set helmet of last spawned entity to stone
    wait 2 second
    loop 260 times:
        wait 3 ticks
        add 0.05 to y-coordinate of {_temp}
        teleport last spawned entity to {_temp}
    broadcast "done"

if you run this code though it'll be very jiggery and will work weirdly

code_language.skript:
on rightclick on non-burning furnace:
    cancel event
    spawn 1 of armor stand at event-block
    add "{NoGravity:1b,Small:1,Invisible:1,Invulnerable:1,NoBasePlate:1,PersistenceRequired:1}" to nbt of last spawned entity
    set {_temp} to location of event-block
    set helmet of last spawned entity to stone
    wait 2 second
    loop 260 times:
        wait 3 ticks
        add 0.05 to y-coordinate of {_temp}
        teleport last spawned entity to {_temp}
    broadcast "done"
 
Last spawned entity only works when a mob is spawned, if you make a loop it will disappear because it has already passed the event that the entity spawned
code_language.skript:
on rightclick on non-burning furnace:
    cancel event
    spawn 1 of armor stand at event-block
    set {_x} to last spawned entity
    add "{NoGravity:1b,Small:1,Invisible:1,Invulnerable:1,NoBasePlate:1,PersistenceRequired:1}" to nbt of {_x}
    set {_temp} to location of event-block
    set helmet of {_x} to stone
    wait 2 second
    loop 260 times:
        wait 3 ticks
        add 0.05 to y-coordinate of {_temp}
        teleport {_x} to {_temp}
    broadcast "done"
 
Last spawned entity only works when a mob is spawned, if you make a loop it will disappear because it has already passed the event that the entity spawned
code_language.skript:
on rightclick on non-burning furnace:
    cancel event
    spawn 1 of armor stand at event-block
    set {_x} to last spawned entity
    add "{NoGravity:1b,Small:1,Invisible:1,Invulnerable:1,NoBasePlate:1,PersistenceRequired:1}" to nbt of {_x}
    set {_temp} to location of event-block
    set helmet of {_x} to stone
    wait 2 second
    loop 260 times:
        wait 3 ticks
        add 0.05 to y-coordinate of {_temp}
        teleport {_x} to {_temp}
    broadcast "done"
Not exactly how last spawed entity works m8 :emoji_slight_smile: the variable that holds the last spawned entity will only ever be updated when a new entity spawns.. if i spawn an entity in and make it so no other entity can spawn then last spawned entity will be the same entity i spawned in. The problem is not to do with the entity but to do with how minecraft or spigot or skript not to sure handles relative coordinates with armor stands
 
Not exactly how last spawed entity works m8 :emoji_slight_smile: the variable that holds the last spawned entity will only ever be updated when a new entity spawns.. if i spawn an entity in and make it so no other entity can spawn then last spawned entity will be the same entity i spawned in. The problem is not to do with the entity but to do with how minecraft or spigot or skript not to sure handles relative coordinates with armor stands
This is becouse of minecraft it self. minecraft consists of a grid but the cordinates to but on a smaller scale. this meens that if a movement distance is to low itwont move if i am right the slowest you can get it moving smoothly is 0.05 blocks a tick
 
Not exactly how last spawed entity works m8 :emoji_slight_smile: the variable that holds the last spawned entity will only ever be updated when a new entity spawns.. if i spawn an entity in and make it so no other entity can spawn then last spawned entity will be the same entity i spawned in. The problem is not to do with the entity but to do with how minecraft or spigot or skript not to sure handles relative coordinates with armor stands
so enjoy the bug :emoji_slight_smile:
 
Last edited by a moderator:
This is becouse of minecraft it self. minecraft consists of a grid but the cordinates to but on a smaller scale. this meens that if a movement distance is to low itwont move if i am right the slowest you can get it moving smoothly is 0.05 blocks a tick
Although the logic makes sense not to sure it's right xD, how can i move it 0.5 blocks smoothly a tick on absolute coordinates but not on relative ones? i can move it 0.1 of a block every tick on absloute coordinates smoothly but not on realtive coordinates
 
Status
Not open for further replies.