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
72
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
 
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
Yeah this is happening because you aren't providing the proper arguments for get, set, and create player profile.
 
It might work in recent versions of the api, or with paper, which has a direct getPlayerProfile() method in the player class, rather than the offline player class https://jd.papermc.io/paper/1.20.6/org/bukkit/entity/Player.html#getPlayerProfile()

It's likely just a 1.8 problem though. Although, the command also calls for a string so try
/setskin "Skeppy" instead of /setskin Skeppy

[16:08:11 INFO]: iLilyy issued server command: /setskin "Skeppy"
[16:08:11 INFO]: [Skript] No matching non-static method: CraftPlayer#getPlayerProfile called without arguments
[16:08:11 INFO]: [Skript] No matching non-static method: CraftPlayer#setPlayerProfile called with (null (Null))
[16:08:11 INFO]: [Skript] No matching non-static method: CraftServer#createProfile called with ("Skeppy" (String))
[16:08:11 INFO]: [Skript] No matching non-static method: CraftPlayer#getPlayerProfile called without arguments
[16:08:11 WARN]: Exception in thread "Craft Scheduler Thread - 0"
[16:08:11 WARN]: org.apache.commons.lang.UnhandledException: Plugin skript-reflect v2.3 generated an exception while executing task 40
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


Same issue, I used the exact code from Gryphon2029.
 
Seems like its a problem with the api for 1.8. Such an old version of paper (assuming you're using a 1.8.8 build https://papermc.io/downloads/all) might not have it properly setup.
so, how would I create a disguise skript that:
- completely changes the player's username (autocomplete, nametag, tablist, and uuid)
- hides the original executor's username (autocomplete, nametag, tablist, and uuid)
- changes the player's skin
and
- changes the player's cape
whilst being able to maintain my version.
KEEP IN MIND, I DO NOT MIND INSTALLING ANY OTHER ADDONS :emoji_stuck_out_tongue:
 
if you want a disguise you either need to update your server or get some sort of disguise plugin elsewhere.