Player Zombies

Planning
Step 1
The new version of me

In this lesson we will create a zombie version of any player who dies.

Temp1515712527
Step 2
Call the player death event

events.entityDeath triggers when any entity dies

Temp1515712744
Step 3
Select only players

Use an if statement to limit the function to just players

Temp1515712862

place the above code inside your function

Temp1516670051
Step 4
Create variables to store useful information

use the player in the event to get a world, location and name

Temp1516670115

-----------------------------------------------------------------------------------------------------------------

Temp1516670123
Step 5
Create some special effects

we can also use world.strikeLightning( loc ); to create real lightning

Temp1516670162

-----------------------------------------------------------------------------------------------------------------

Temp1516670173 Temp1515865253
Step 6
Zombies

world is the world we declared up above
loc is the location we declared above
world.spawnEntity can spawn different entities by changing the entityType

Temp1516670215

-----------------------------------------------------------------------------------------------------------------

Temp1516670235 Temp1516670287
Step 7
Store our zombie in a variable so we can change it!

world.spawnEntity gives us back the entity it spawned.
we'll store that in the playerZombie variable

Temp1515869544

-----------------------------------------------------------------------------------------------------------------

Temp1516670411
Step 8
Name that Zombie!

playerZombie.customName sets the value of our zombie's name.
name is the variable we declared earlier to be our player's name.

Temp1515869856

-----------------------------------------------------------------------------------------------------------------

Temp1516670478 Temp1515870715
Step 9
Preparing our equipment

We set up 2 variables
zEquipment stores the zombie equipment
pEquipment stores the player equipment

Temp1515870601

-----------------------------------------------------------------------------------------------------------------

Temp1516670557
Step 10
Equip that Zombie!

for each piece of our equipment, we give that equipment to the zombie

Temp1515871009

-----------------------------------------------------------------------------------------------------------------

Temp1516670584 Temp1515871298
Player Zombies Info

Account

MVCode Clubs

Created By

Missing tiny jake wheaton

Access Level

premium

For Teachers and Schools

Teach coding to your students with MVCode Teach

MVCode offers an integrated product designed to teach coding to students.

Learn more about MVCode Teach