Interactive Kinetic Intelligence 1.0

  • 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!

Avaplays

Member
Jan 29, 2017
23
2
3
28
A virtual kinetic intelligence armor stand;
Version: 1.0
  • Walk
  • No walk trough blocks
  • Can go up- downstair

code_language.skript:
every 10 ticks:
    loop all armor stands:
        if loop-entity's name contains "IKI":
            set {IKI::ID::%loop-entity's name%} to "%loop-entity's name%"
            replace all "IKI\" with "" in {IKI::ID::%loop-entity's name%}
            add "1" and "2" to {_d::%{IKI::ID::%loop-entity's name%}%::*}
            set {_d::%{IKI::ID::%loop-entity's name%}%} to a random element out of {_d::%{IKI::ID::%loop-entity's name%}%::*}
            set {_l::%{IKI::ID::%loop-entity's name%}%} to location of loop-entity
            if block in front of loop-entity's head is air:
                add "x" and "z" to {_di::%{IKI::ID::%loop-entity's name%}%::*}
                set {_di::%{IKI::ID::%loop-entity's name%}%} to a random element out of {_di::%{IKI::ID::%loop-entity's name%}%::*}
                if {_di::%{IKI::ID::%loop-entity's name%}%} is "x":
                    set {_l::%{IKI::ID::%loop-entity's name%}%} to location of loop-entity
                    if {_d::%{IKI::ID::%loop-entity's name%}%} is "1":
                        add "{Rotation:[90f,90f]}" to nbt of loop-entity
                        add -1 to x-coordinate of {_l::%{IKI::ID::%loop-entity's name%}%}
                    else:
                        add "{Rotation:[-90f,-90f]}" to nbt of loop-entity
                        add 1 to x-coordinate of {_l::%{IKI::ID::%loop-entity's name%}%}
                    if block at {_l::%{IKI::ID::%loop-entity's name%}%} is air:
                        teleport loop-entity to {_l::%{IKI::ID::%loop-entity's name%}%}
                    else:
                        set {_l2::%{IKI::ID::%loop-entity's name%}%} to location of block above {_l::%{IKI::ID::%loop-entity's name%}%}
                        if block at {_l2::%{IKI::ID::%loop-entity's name%}%} is air:
                            set {_l3::%{IKI::ID::%loop-entity's name%}%} to location of block above {_l2::%{IKI::ID::%loop-entity's name%}%}
                            if block at {_l3::%{IKI::ID::%loop-entity's name%}%} is air:
                                teleport loop-entity to {_l2::%{IKI::ID::%loop-entity's name%}%}
                else if {_di::%{IKI::ID::%loop-entity's name%}%} is "z":
                    set {_lz::%{IKI::ID::%loop-entity's name%}%} to location of loop-entity
                    if {_dz::%{IKI::ID::%loop-entity's name%}%} is "1":
                        add "{Rotation:[0f,0f]}" to nbt of loop-entity
                        add -1 to z-coordinate of {_lz::%{IKI::ID::%loop-entity's name%}%}
                    else:
                        add "{Rotation:[360f,360f]}" to nbt of loop-entity
                        add 1 to z-coordinate of {_lz::%{IKI::ID::%loop-entity's name%}%}
                    if block at {_lz::%{IKI::ID::%loop-entity's name%}%} is air:
                        teleport loop-entity to {_lz::%{IKI::ID::%loop-entity's name%}%}
                    else:
                        set {_lz2::%{IKI::ID::%loop-entity's name%}%} to location of block above {_lz::%{IKI::ID::%loop-entity's name%}%}
                        if block at {_lz2::%{IKI::ID::%loop-entity's name%}%} is air:
                            set {_lz3::%{IKI::ID::%loop-entity's name%}%} to location of block above {_lz2::%{IKI::ID::%loop-entity's name%}%}
                            if block at {_lz3::%{IKI::ID::%loop-entity's name%}%} is air:
                                teleport loop-entity to {_lz2::%{IKI::ID::%loop-entity's name%}%}
                
on right click:
    if target block is not air:
        if distance between target block and player is less than 5:
            if player's tool is armor stand:
                if name of player's tool is "§bKinetic Intelligence":
                    if lore of player's tool contains "1":
                        cancel event
                        set {_location} to location of event-block
                        spawn armor stand at location 1 above {_location}
                        set {_skull} to "%player's name%" parsed as offline player
                        add "{Invisible:0,Invulnerable:0,ShowArms:1,Small:0,NoBasePlate:1,NoGravity:0,ArmorItems:[{},{},{},{}],Pose:{Head:[0f,0f,0f]}}" to nbt of last spawned armor stand
                        set last spawned armor stand's helmet to {_skull}'s skull
                        set last spawned armor stand's tool to diamond pickaxe
                        set last spawned armor stand's chestplate to diamond chestplate
                        set last spawned armor stand's leggings to diamond leggings
                        set last spawned armor stand's boots to diamond boots
                        set {_KIID} to "%random integer between 10 and 99%\%random integer between 100 and 999%\%random integer between 10 and 99%\%random integer between 0 and 9%"
                        set last spawned armor stand's name to "IKI\%{_KIID}%"
                        send "§bInteractive Kinetic Intelligence §7placed."
                    else:
                        cancel event
                        set {_location} to location of event-block
                        spawn armor stand at location 1 above {_location}
                        set {_skull} to "%player's name%" parsed as offline player
                        add "{Invisible:0,Invulnerable:0,ShowArms:1,Small:0,NoBasePlate:1,NoGravity:0,ArmorItems:[{},{},{},{}],Pose:{Head:[0f,0f,0f]}}" to nbt of last spawned armor stand
                        set last spawned armor stand's helmet to {_skull}'s skull
                        set last spawned armor stand's tool to diamond pickaxe
                        set last spawned armor stand's chestplate to diamond chestplate
                        set last spawned armor stand's leggings to diamond leggings
                        set last spawned armor stand's boots to diamond boots
                        set {_KIID} to "%random integer between 10 and 99%\%random integer between 100 and 999%\%random integer between 10 and 99%\%random integer between 0 and 9%"
                        set last spawned armor stand's name to "KI\%{_KIID}%"
                        send "§bKinetic Intelligence §7placed."
            
command kinetic [<text>] [<text>]:
    permission: kinetic.*
    trigger:
        if arg-1 is set:
            if arg-1 is "info":
                loop all armor stands:
                    if loop-entity's name contains "KI\":
                        send "%loop-entity's name%: %direction of loop-entity%"
                        send "%loop-entity's name%: %facing of loop-entity%"
                        send "%loop-entity's name%: %loop-entity's location%"
                        send "%loop-entity's name%: %loop-entity's target block%"
                        send "%loop-entity's name%: %block in front of loop-entity%"
                        send "%loop-entity's name%: %block facing of loop-entity%"
            else if arg-1 is "rotate":
                if arg-2 is "0", "-30", "30", "-60", "60", "-90", "90", "180" or "360":
                    loop all armor stands:
                        if loop-entity's name contains "KI\":
                            add "{Rotation:[%arg-2%f,%arg-2%f]}" to nbt of loop-entity
            else if arg-1 is "walkx":
                loop all armor stands:
                    if loop-entity's name contains "KI\":
                        add "1" and "2" to {_d::*}
                        set {_d} to a random element out of {_d::*}
                        set {_b} to a random integer between 10 and 100
                        loop {_b} times:
                            set {_l} to location of loop-entity
                            if block in front of loop-entity's head is air:
                                wait 3 ticks
                                add "{Rotation:[-90f,-90f]}" to nbt of loop-entity
                                add "t" and "f" to {_x::*}
                                set {_x} to a random element out of {_x::*}
                                if {_x} is "t":
                                    set {_l} to location of loop-entity
                                    if {_d} is "1":
                                        add "{Rotation:[90f,90f]}" to nbt of loop-entity
                                        add -1 to x-coordinate of {_l}
                                    else:
                                        add "{Rotation:[-90f,-90f]}" to nbt of loop-entity
                                        add 1 to x-coordinate of {_l}
                                    if block at {_l} is air:
                                        teleport loop-entity to {_l}
                                    else:
                                        set {_l2} to location of block above {_l}
                                        if block at {_l2} is air:
                                            set {_l3} to location of block above {_l2}
                                            if block at {_l3} is air:
                                                teleport loop-entity to {_l2}
            else if arg-1 is "walkz":
                loop all armor stands:
                    if loop-entity's name contains "KI\":
                        add "1" and "2" to {_d::*}
                        set {_d} to a random element out of {_d::*}
                        set {_b} to a random integer between 10 and 100
                        loop {_b} times:
                            set {_l} to location of loop-entity
                            if block in front of loop-entity's head is air:
                                wait 3 ticks
                                add "{Rotation:[180f,180f]}" to nbt of loop-entity
                                add "t" and "f" to {_z::*}
                                set {_z} to a random element out of {_z::*}
                                if {_z} is "t":
                                    if {_d} is "1":
                                        add "{Rotation:[360f,360f]}" to nbt of loop-entity
                                        add -1 to z-coordinate of {_l}
                                    else:
                                        add "{Rotation:[180f,180f]}" to nbt of loop-entity
                                        add 1 to z-coordinate of {_l}
                                    if block at {_l} is air:
                                        teleport loop-entity to {_l}
                                    else:
                                        set {_l2} to location of block above {_l}
                                        if block at {_l2} is air:
                                            set {_l3} to location of block above {_l2}
                                            if block at {_l3} is air:
                                                teleport loop-entity to {_l2}
        else:
            open chest with 1 row named "Kinetic" to player
            wait a tick
            set slot 0 of current inventory of player to armor stand with hidden enchantment named "§bKinetic Intelligence" with lore "§7Version: §b0"
            set slot 1 of current inventory of player to armor stand with hidden enchantment named "§bKinetic Intelligence" with lore "§7Version: §b1"