80 lines
2.0 KiB
Java
80 lines
2.0 KiB
Java
package com.jtrent238.epicproportions.addons.halloween.entity;
|
|
|
|
import net.minecraft.entity.monster.EntityGolem;
|
|
import net.minecraft.init.Blocks;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.world.World;
|
|
|
|
import java.util.Random;
|
|
|
|
public class EntityPumpkinHead extends EntityGolem{
|
|
|
|
public EntityPumpkinHead(World p_i1686_1_) {
|
|
super(p_i1686_1_);
|
|
}
|
|
|
|
/**
|
|
* Returns the sound this mob makes while it's alive.
|
|
*/
|
|
protected String getLivingSound()
|
|
{
|
|
//return "epicproportionsmod_halloween:scarecrow_say";
|
|
return "epicproportionsmod_halloween:pumpkinhead_say";
|
|
}
|
|
|
|
/**
|
|
* Returns the sound this mob makes when it is hurt.
|
|
*/
|
|
protected String getHurtSound()
|
|
{
|
|
return "epicproportionsmod_halloween:pumpkinhead_hurt";
|
|
}
|
|
|
|
/**
|
|
* Returns the sound this mob makes on death.
|
|
*/
|
|
protected String getDeathSound()
|
|
{
|
|
return "epicproportionsmod_halloween:pumpkinhead_death";
|
|
}
|
|
|
|
/**
|
|
* Drop items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean var1, int var2)
|
|
{
|
|
Random rn = new Random();
|
|
int max = 6;
|
|
int min = 1;
|
|
int result = rn.nextInt(max - min + 1) + min;
|
|
System.out.println(result);
|
|
|
|
int dropAmount = result;
|
|
int dropType = rn.nextInt((max - 1) - (min - 1) + 1) + (min - 1);
|
|
//System.out.println(dropType);
|
|
|
|
if(dropType < 0 || dropType > 2) {
|
|
//Logger.logMsg(Logger.INFO, "Droptype was not between 0 and 2! Setting to 0!");
|
|
dropType = 0;
|
|
//System.out.println(dropType);
|
|
}
|
|
|
|
switch(dropType){
|
|
case 0:
|
|
this.entityDropItem(new ItemStack(Blocks.lit_pumpkin, dropAmount), 1F);
|
|
break;
|
|
case 1:
|
|
this.entityDropItem(new ItemStack(Blocks.pumpkin, dropAmount), 1F);
|
|
break;
|
|
case 2:
|
|
this.entityDropItem(new ItemStack(Blocks.lit_pumpkin, dropAmount), 1F);
|
|
this.entityDropItem(new ItemStack(Blocks.pumpkin, dropAmount), 1F);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
}
|