Solved A player head on a fence

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Aralwen

Active Member
May 26, 2017
164
14
18
25
Hello, when a player dies, I'm looking to place a fence and over that fence the player's head. I found for the fence, for cons for the player's head, I do not see how to do.

Questions:
  • How to place the block on the barrier
  • How to define the player's head instead of a basic head
Code:

code_language.skript:
on death:
    set {_location} to victim's location
    force victim to respawn
    set {_x} to x coord of {_location}
    set {_y} to y coord of {_location}
    set {_y} to {_y} +1
    set {_z} to z coord of {_location}
    set {_location2} to location {_x}, {_y}, {_z} in world of victim
    set block at {_location} to dark_oak_fence #That work
    set block at {_location2} to player head #That doesn't work and how to define the player's head

Thank's in advance for helping me !
 
Okay so I searched and I searched and turns out Skript doesn't handle players heads as blocks,... BUT... Skellett does.
So if you have skellett you can do this
code_language.skript:
on death:
    set block at victim to dark oak fence
    set block at location above location of victim to floor head
    set skull owner of block at location above location of victim to victim
 
Okay so I searched and I searched and turns out Skript doesn't handle players heads as blocks,... BUT... Skellett does.
So if you have skellett you can do this
code_language.skript:
on death:
    set block at victim to dark oak fence
    set block at location above location of victim to floor head
    set skull owner of block at location above location of victim to victim
Thank you very much for your research, the head lands well, but does not display the player's. Moreover, it shows an error in the console

08GR0YC.png
 
damn.... it might be an issue with 1.8
I found how to no longer have the errors in the console : add a wait 1 tick after set block
By cons the head is still a skeleton head and not that head of the player.
It must come from the id floor head, but player head doesn't work :/
 
Yeah again, i really have no idea... this is why i work with up to date servers... 1.8 seems to have too many problems with skript / plugin development
 
Yeah again, i really have no idea... this is why i work with up to date servers... 1.8 seems to have too many problems with skript / plugin development
I do not like new versions at all :emoji_frowning:
I will do some research, if ever an idea comes to you, do not hesitate to retort :emoji_slight_smile:
 
An easy alternative is to simply use vanilla minecraft's basic fill command:

code_language.skript:
/fill x1 y1 z1 x2 y2 z2 minecraft:skull 1 replace {SkullType:3, ExtraType:Notch}"

Where the number "1" represents the orientation of the skull, and "ExtraType" representing the Skull Owner's name.

The only thing left to do is to integrate this command into Skript, like so:

code_language.skript:
on death:
    set {_location} to victim's location
    force victim to respawn
    set {_x} to x coord of {_location}
    set {_y} to y coord of {_location}
    set {_y} to {_y} +1
    set {_z} to z coord of {_location}
    set {_location2} to location {_x}, {_y}, {_z} in world of victim
    set block at {_location} to dark_oak_fence #That work
    execute console command "/fill %{_x}% %{_y}% %{_z}% %{_x}% %{_y}% %{_z}% minecraft:skull 1 replace {SkullType:3, ExtraType:%victim%}" #Vanilla work-around

The only problem with this method is that Mojang will occasionally update the command syntax of it's commands, and so you might have to update it to fit whatever version of Minecraft you're using. This command was tested on 1.12.2.
 
An easy alternative is to simply use vanilla minecraft's basic fill command:

code_language.skript:
/fill x1 y1 z1 x2 y2 z2 minecraft:skull 1 replace {SkullType:3, ExtraType:Notch}"

Where the number "1" represents the orientation of the skull, and "ExtraType" representing the Skull Owner's name.

The only thing left to do is to integrate this command into Skript, like so:

code_language.skript:
on death:
    set {_location} to victim's location
    force victim to respawn
    set {_x} to x coord of {_location}
    set {_y} to y coord of {_location}
    set {_y} to {_y} +1
    set {_z} to z coord of {_location}
    set {_location2} to location {_x}, {_y}, {_z} in world of victim
    set block at {_location} to dark_oak_fence #That work
    execute console command "/fill %{_x}% %{_y}% %{_z}% %{_x}% %{_y}% %{_z}% minecraft:skull 1 replace {SkullType:3, ExtraType:%victim%}" #Vanilla work-around

The only problem with this method is that Mojang will occasionally update the command syntax of it's commands, and so you might have to update it to fit whatever version of Minecraft you're using. This command was tested on 1.12.2.
It works, thank you very much! (and sorry for the response time)
 
Status
Not open for further replies.