Solved How do i Print Player heads in chat?

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

    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!

cdoxy

Member
Aug 9, 2024
43
2
8
I want to make a system to print a player's head using coloured cube characters, how would i go about that using Skript?

I have Skript version 2.9.0, and here are my installed addons:
SkCord, skript-particle, SkDragon, SkRayFall, SkBee, SharpSk, MundoSk.
 
you could do something like this to get it, but you will have to have skript reflect as a addon to use the java / url stuff!

Code:
import:
    java.net.URL
    javax.imageio.ImageIO

command skull [<offline player>] [<number>]:
    trigger:
        SkullChat(arg-1, arg-2)

function SkullChat(p: object, d: number) :: strings:
    set {_loc} to new URL("https://minotar.net/avatar/%{_p}%/%{_d}%")
    set {_image} to ImageIO.read({_loc})
    set {_height} to {_image}.getHeight()
    set {_width} to {_image}.getWidth()
    set {_size} to {_d}
    set {_mult1} to {_height} / {_size}
    set {_mult2} to {_width} / {_size}
    loop {_size} times:
        loop {_size} times:
            set {_rgb} to {_image}.getRGB((((loop-value-1) - 1) * {_mult2}), (((loop-value-2) - 1) * {_mult1}))
            set {_color} to new (the class "java.awt.Color")({_rgb})
            set {_chatcolor} to (the class "net.md_5.bungee.api.ChatColor").of({_color})
            set {_image1::%loop-value-2%} to join {_image1::%loop-value-2%}, {_chatcolor}.toString(), "&l⬛"
    broadcast {_image1::*}

good luck coding! hope you like this. i t basicly gets the colours and pixels out of the api. use /skull yourname size. to get the skull in chat!
please give me a like if it worked for you!
 
you could do something like this to get it, but you will have to have skript reflect as a addon to use the java / url stuff!

Code:
import:
    java.net.URL
    javax.imageio.ImageIO

command skull [<offline player>] [<number>]:
    trigger:
        SkullChat(arg-1, arg-2)

function SkullChat(p: object, d: number) :: strings:
    set {_loc} to new URL("https://minotar.net/avatar/%{_p}%/%{_d}%")
    set {_image} to ImageIO.read({_loc})
    set {_height} to {_image}.getHeight()
    set {_width} to {_image}.getWidth()
    set {_size} to {_d}
    set {_mult1} to {_height} / {_size}
    set {_mult2} to {_width} / {_size}
    loop {_size} times:
        loop {_size} times:
            set {_rgb} to {_image}.getRGB((((loop-value-1) - 1) * {_mult2}), (((loop-value-2) - 1) * {_mult1}))
            set {_color} to new (the class "java.awt.Color")({_rgb})
            set {_chatcolor} to (the class "net.md_5.bungee.api.ChatColor").of({_color})
            set {_image1::%loop-value-2%} to join {_image1::%loop-value-2%}, {_chatcolor}.toString(), "&l⬛"
    broadcast {_image1::*}

good luck coding! hope you like this. i t basicly gets the colours and pixels out of the api. use /skull yourname size. to get the skull in chat!
please give me a like if it worked for you!
but one thing, it didnt seem to work.

i reloaded the skript with no errors, but it did not broadcast the skull.

any ideas?
 
nevermind, turns out i just put the broadcast part in the wrong bit! XD