1.8 Disguise

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

Jacob105

Active Member
Aug 7, 2020
65
1
8
24
Category: Staff/YT(?) Utilities

Suggested name: idm lmao

Spigot/Skript Version:
Paper 1.8.8 (445)
Skript 2.6.5-for-1.8

What I want:
Using Skript-reflect (because I know it's impossible to do this without it), make a skript that allows players to change their name (nametag, tab, autocomplete, basically their whole gameprofile) and skin.

Ideas for commands:
/disguise <player>
/undisguise
das it :emoji_stuck_out_tongue:

Ideas for permissions: make it permless, I have a fun idea for this(?)

When I'd like it by:
Hopefully within the week :emoji_stuck_out_tongue:
 
see if this shanebee code works.

AppleScript:
# Simple Skin Changer
# By: ShaneBee

# This little snippet allows you to change a player's skin and their profile name

# Requires: Skript-Reflect and Paper (I should hope you already have Paper)


#! SET SKIN EFFECT !#
# Player = the player who's skin is going to change
# String = the name of the player to grab a skin from
effect set skin of %player% to %string%:
    trigger:
        set {_p} to expr-1
        set {_n} to expr-2

        create new section with {_name}, {_player} stored in {_sec}:
            set {_pro} to server.getServer().createProfile({_name})
            {_pro}.complete(true)
            set {_text} to {_pro}.getTextures()
            set {_pro} to {_player}.getPlayerProfile()
            {_pro}.setTextures({_text})
            return {_pro}
        run section {_sec} async with arguments {_n} and {_p} and store result in {_pro} and wait
        {_p}.setPlayerProfile({_pro})

#! PROFILE NAME EXPRESSION !#
# this allows you to change the player's profile name (name in tablist and above head)
expression [player] profile name of %player%:
    get:
        return (expr-1).getPlayerProfile().getName()
    set:
        set {_player} to expr-1
        set {_name} to change value
        if length of {_name} > 16:
            set {_name} to first 16 characters of {_name}
        set {_pro} to {_player}.getPlayerProfile()
        {_pro}.setName({_name})
        {_player}.setPlayerProfile({_pro})

#! EXAMPLE USAGE !#
command /setskin <name:string>:
    trigger:
        set profile name of player to {_name}
        set skin of player to {_name}
 
see if this shanebee code works.

AppleScript:
# Simple Skin Changer
# By: ShaneBee

# This little snippet allows you to change a player's skin and their profile name

# Requires: Skript-Reflect and Paper (I should hope you already have Paper)


#! SET SKIN EFFECT !#
# Player = the player who's skin is going to change
# String = the name of the player to grab a skin from
effect set skin of %player% to %string%:
    trigger:
        set {_p} to expr-1
        set {_n} to expr-2

        create new section with {_name}, {_player} stored in {_sec}:
            set {_pro} to server.getServer().createProfile({_name})
            {_pro}.complete(true)
            set {_text} to {_pro}.getTextures()
            set {_pro} to {_player}.getPlayerProfile()
            {_pro}.setTextures({_text})
            return {_pro}
        run section {_sec} async with arguments {_n} and {_p} and store result in {_pro} and wait
        {_p}.setPlayerProfile({_pro})

#! PROFILE NAME EXPRESSION !#
# this allows you to change the player's profile name (name in tablist and above head)
expression [player] profile name of %player%:
    get:
        return (expr-1).getPlayerProfile().getName()
    set:
        set {_player} to expr-1
        set {_name} to change value
        if length of {_name} > 16:
            set {_name} to first 16 characters of {_name}
        set {_pro} to {_player}.getPlayerProfile()
        {_pro}.setName({_name})
        {_player}.setPlayerProfile({_pro})

#! EXAMPLE USAGE !#
command /setskin <name:string>:
    trigger:
        set profile name of player to {_name}
        set skin of player to {_name}

Nope, nothing happens and my console spits out the following:
(I'm using Skript-2.6.5-for-1.8 + skript-reflect 2.3)
don't ask why I'm using 1.8 ;-;

[18:21:35 INFO]: [Skript] No matching non-static method: CraftPlayer#getPlayerProfile called without arguments
[18:21:35 INFO]: [Skript] No matching non-static method: CraftPlayer#setPlayerProfile called with (null (Null))
[18:21:35 INFO]: [Skript] No matching non-static method: CraftServer#createProfile called with (skeppy (String))
[18:21:35 INFO]: [Skript] No matching non-static method: CraftPlayer#getPlayerProfile called without arguments
[18:21:35 WARN]: Exception in thread "Craft Scheduler Thread - 4"
[18:21:35 WARN]: org.apache.commons.lang.UnhandledException: Plugin skript-reflect v2.3 generated an exception while executing task 102
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
at org.github.paperspigot.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:23)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at ch.njol.skript.lang.Variable.change(Variable.java:523)
at com.btk5h.skriptmirror.skript.reflect.sections.EffRunSection.storeResult(EffRunSection.java:141)
at com.btk5h.skriptmirror.skript.reflect.sections.EffRunSection.lambda$walk$2(EffRunSection.java:96)
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59)
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
... 4 more