# Solved A player head on a fence

Discussion in 'Skript' started by Aralwen, Aug 23, 2018.

Not open for further replies.
1. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
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
Code:

Code (Skript):
1. on death:
2.     set {_location} to victim's location
3.     force victim to respawn
4.     set {_x} to x coord of {_location}
5.     set {_y} to y coord of {_location}
6.     set {_y} to {_y} +1
7.     set {_z} to z coord of {_location}
8.     set {_location2} to location {_x}, {_y}, {_z} in world of victim
9.     set block at {_location} to dark_oak_fence #That work
10.     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 !

#1
Post #12 by jjpwn1, Aug 23, 2018
3. ### ShaneBee ModeratorResource StaffSupporter +Addon Developer

Joined:
Sep 7, 2017
Messages:
2,184
220
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 (Skript):
1. on death:
2.     set block at victim to dark oak fence
3.     set block at location above location of victim to floor head
4.     set skull owner of block at location above location of victim to victim
5.

#2
4. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
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

#3
5. ### ShaneBee ModeratorResource StaffSupporter +Addon Developer

Joined:
Sep 7, 2017
Messages:
2,184
220
oops... try "on death of player" in stead of "on death"

#4
6. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
Always the same problem

#5
7. ### ShaneBee ModeratorResource StaffSupporter +Addon Developer

Joined:
Sep 7, 2017
Messages:
2,184
220
damn.... it might be an issue with 1.8

#6
8. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
I found how to no longer have the errors in the console : add a wait 1 tick after set block
It must come from the id floor head, but player head doesn't work :/

#7
9. ### ShaneBee ModeratorResource StaffSupporter +Addon Developer

Joined:
Sep 7, 2017
Messages:
2,184
220
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

#8
10. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
I do not like new versions at all
I will do some research, if ever an idea comes to you, do not hesitate to retort

#9
11. ### ShaneBee ModeratorResource StaffSupporter +Addon Developer

Joined:
Sep 7, 2017
Messages:
2,184
220
Will do.... its super hard for me to fix things that aren't working for you if they are working for me... thats the unfortunate part

#10
12. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
Yeah I understand
Thanks anyway

#11
• Friendly x 1
13. ### jjpwn1 Member

Joined:
Aug 18, 2018
Messages:
12
8
An easy alternative is to simply use vanilla minecraft's basic fill command:

Code (Skript):
1. /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 (Skript):
1. on death:
2.     set {_location} to victim's location
3.     force victim to respawn
4.     set {_x} to x coord of {_location}
5.     set {_y} to y coord of {_location}
6.     set {_y} to {_y} +1
7.     set {_z} to z coord of {_location}
8.     set {_location2} to location {_x}, {_y}, {_z} in world of victim
9.     set block at {_location} to dark_oak_fence #That work
10.     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.

#12
• Agree x 1
14. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
It works, thank you very much! (and sorry for the response time)

#13
Not open for further replies.