Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. [Unnicker] How to get the Textures / Property of the GameProfile of a Player

[Unnicker] How to get the Textures / Property of the GameProfile of a Player

Scheduled Pinned Locked Moved Solved ScriptAPI
4 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MarlonM Offline
    MarlonM Offline
    Marlon
    wrote on last edited by
    #1

    A certain Server has a Nickname System which changes the Name and the Skin of the Player but the Skin of the nicked Player isn't the Skin of the Nickname.
    What i try to do is, when a Player nicks himself, the Script checks if the Skins aren't the same.
    I need to get the Property of the (Skin)-Texture of the Player in the Tablist, so i can check if its the same Texture as the Skin of the UUID stored at:
    https://sessionserver.mojang.com/session/minecraft/profile/<UUID>

    ///api_version=2
    (script = registerScript({
        name: "Unnicker",
        version: "1.0.0",
        authors: ["Marlon"]
    })).import("Core.lib");
    
    var S38PacketPlayerListItem = Java.type("net.minecraft.network.play.server.S38PacketPlayerListItem");
    var Action = Java.type("net.minecraft.network.play.server.S38PacketPlayerListItem.Action");
    var AddPlayerData = Java.type("net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData");
    var Property = Java.type("com.mojang.authlib.properties.Property")
    
    script.registerModule({
        name: "Unnicker",
        category: "Misc",
        description: "Warns when someone is nicked"
    }, function (module) {
        module.on("packet", function(eventData) {
            var packet = eventData.getPacket();
    
            if(packet instanceof S38PacketPlayerListItem) {
                if(packet.getAction() == Action.ADD_PLAYER) {
                    var entries = packet.getEntries();
                    var firstEntry = entries.get(0);
                    var gameProfile = firstEntry.getProfile();
                    var properties = gameProfile.getProperties();
                    var textures = properties.get("textures");
    
                    Chat.print(textures);
                }
            }
        });
    });
    

    Output of the Code is:
    44c0194f-3648-4cbc-bbab-a68aa1081a6b-grafik.png
    But if i run the Method "getName()" for example it wont show anything in the chat.
    Hope someone understands my problem and can solve it. ๐Ÿ˜‰

    FaaatPotatoF 1 Reply Last reply
    0
    • MarlonM Marlon

      A certain Server has a Nickname System which changes the Name and the Skin of the Player but the Skin of the nicked Player isn't the Skin of the Nickname.
      What i try to do is, when a Player nicks himself, the Script checks if the Skins aren't the same.
      I need to get the Property of the (Skin)-Texture of the Player in the Tablist, so i can check if its the same Texture as the Skin of the UUID stored at:
      https://sessionserver.mojang.com/session/minecraft/profile/<UUID>

      ///api_version=2
      (script = registerScript({
          name: "Unnicker",
          version: "1.0.0",
          authors: ["Marlon"]
      })).import("Core.lib");
      
      var S38PacketPlayerListItem = Java.type("net.minecraft.network.play.server.S38PacketPlayerListItem");
      var Action = Java.type("net.minecraft.network.play.server.S38PacketPlayerListItem.Action");
      var AddPlayerData = Java.type("net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData");
      var Property = Java.type("com.mojang.authlib.properties.Property")
      
      script.registerModule({
          name: "Unnicker",
          category: "Misc",
          description: "Warns when someone is nicked"
      }, function (module) {
          module.on("packet", function(eventData) {
              var packet = eventData.getPacket();
      
              if(packet instanceof S38PacketPlayerListItem) {
                  if(packet.getAction() == Action.ADD_PLAYER) {
                      var entries = packet.getEntries();
                      var firstEntry = entries.get(0);
                      var gameProfile = firstEntry.getProfile();
                      var properties = gameProfile.getProperties();
                      var textures = properties.get("textures");
      
                      Chat.print(textures);
                  }
              }
          });
      });
      

      Output of the Code is:
      44c0194f-3648-4cbc-bbab-a68aa1081a6b-grafik.png
      But if i run the Method "getName()" for example it wont show anything in the chat.
      Hope someone understands my problem and can solve it. ๐Ÿ˜‰

      FaaatPotatoF Offline
      FaaatPotatoF Offline
      FaaatPotato
      wrote on last edited by
      #2

      @Marlon

      var textures = properties.get("textures").iterator().next()
      Chat.print(textures.getValue());
      

      returns smth similar to this:

      3fa62073-ffab-45d8-9d8f-f720fc762520-image.png

      MarlonM 1 Reply Last reply
      1
      • FaaatPotatoF FaaatPotato

        @Marlon

        var textures = properties.get("textures").iterator().next()
        Chat.print(textures.getValue());
        

        returns smth similar to this:

        3fa62073-ffab-45d8-9d8f-f720fc762520-image.png

        MarlonM Offline
        MarlonM Offline
        Marlon
        wrote on last edited by
        #3

        @FaaatPotato Thank you it works! ๐Ÿ™‚

        FaaatPotatoF 1 Reply Last reply
        0
        • MarlonM Marlon

          @FaaatPotato Thank you it works! ๐Ÿ™‚

          FaaatPotatoF Offline
          FaaatPotatoF Offline
          FaaatPotato
          wrote on last edited by
          #4

          @Marlon no problem homie

          1 Reply Last reply
          0
          • MarlonM Marlon has marked this topic as solved on

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better ๐Ÿ’—

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          About
          • Terms of Service
          • Privacy Policy
          • Status
          • Contact Us
          Downloads
          • Releases
          • Source code
          • License
          Docs
          • Tutorials
          • CustomHUD
          • AutoSettings
          • ScriptAPI
          Community
          • Forum
          • Guilded
          • YouTube
          • Twitter
          • D.Tube
          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups