Player Head Drops Function for Minecraft 1.12

 

If you ever wondered how to get player heads in Minecraft, this Minecraft Function makes players drop their heads upon death by another player. Included in the pack is a Ruby script tool that generates a loop function with the players’ information.

Minecraft Function Download

Download the zip file and extract the contents into your Minecraft map inside the data/functions folder.

Additional steps

Once the function files are in place go to the Player-Head-Drops folder and edit the loop function (phd_loop.mcfunction).

Add a command for each player on your server replacing PlayerIGN with your server members in-game names:

execute @a[name=PlayerIGN,score_PHDdeath_min=1] ~ ~ ~ give @a[score_PHDkill_min=1] skull 1 3 {SkullOwner:”PlayerIGN”,display:{LocName:”PlayerIGN Head”}}

Once that is done go to Minecraft and execute the /reload command. Now you can install the function with the following command:

/function player-head-drops:phd_install

A message should display saying that the installation was successful.

For specific instructions watch the video.

Generating the Loop Function

In my YouTube video above I explain why is better to have a certain type of format for the Player Heads and how the Ruby script I created can help.

Player Heads Infographic

To be able to run the script you need the latest version of Ruby installed and the httparty Gem.

The script works two ways, the first one tries to find a whitelist.json file to parse and start sending requests with that information to build the Function for you. Copy or move the script (phd_loopbuilder.rb) and your whitelist file (whitelist.json) so they are in the same folder and run the script without parameters

ruby phd_loopbuilder.rb

The alternative is to give IGN’s as parameters to the script, for that just write the in-game name of your server members separated by spaces. For example:

ruby phd_loopbuilder.rb Player1 Player2 anotherPlayer

The generated loop function (phd_loop.mcfunction) needs to be moved to the data/functions/Player-Head-Drops folder, replace the old one. Don’t forget to /reload while in the game.

If you don’t know how to run this script I can run it and generate that file for you, feel free to contact me on Discord.

This project is also on GitHub if you want to contribute to the Function or the script.

 

If you want to see more content or just want to be in touch, here are some websites where you can find me

 Twitter   Discord   Mixer   Player.me   Github

Can't get enough of the cat on the internet?