diff --git a/src/main/java/mod/emt/harkenscythe/events/HSLivingDeathEvent.java b/src/main/java/mod/emt/harkenscythe/events/HSLivingDeathEvent.java index b526910..22c8b90 100644 --- a/src/main/java/mod/emt/harkenscythe/events/HSLivingDeathEvent.java +++ b/src/main/java/mod/emt/harkenscythe/events/HSLivingDeathEvent.java @@ -5,6 +5,7 @@ import mod.emt.harkenscythe.entities.HSEntityHarbinger; import mod.emt.harkenscythe.entities.HSEntitySoul; import mod.emt.harkenscythe.init.HSEnchantments; +import mod.emt.harkenscythe.init.HSItems; import mod.emt.harkenscythe.init.HSSoundEvents; import mod.emt.harkenscythe.items.tools.HSScythe; import net.minecraft.enchantment.Enchantment; @@ -41,6 +42,11 @@ else if (trueSource instanceof HSEntityHarbinger) { spawnSpectralEntity(world, entity, entity.getPosition()); } + // TODO: Set entity data to determine spectral variant + else if (!world.isRemote && entity.getCustomNameTag().contains("Spectral")) + { + entity.dropItem(HSItems.soul_essence, 1); + } } public static void spawnSoul(World world, EntityLivingBase entity) @@ -61,8 +67,8 @@ public static void spawnSpectralEntity(World world, EntityLivingBase entity, Blo // TODO: Set entity data to determine spectral variant entity.setCustomNameTag("Spectral " + entity.getName()); entity.setHealth(entity.getMaxHealth()); + entity.deathTime = 0; entity.isDead = false; - } // Spawn ectoglobin else diff --git a/src/main/java/mod/emt/harkenscythe/events/HSLivingDropsEvent.java b/src/main/java/mod/emt/harkenscythe/events/HSLivingDropsEvent.java new file mode 100644 index 0000000..6ec2e11 --- /dev/null +++ b/src/main/java/mod/emt/harkenscythe/events/HSLivingDropsEvent.java @@ -0,0 +1,23 @@ +package mod.emt.harkenscythe.events; + +import mod.emt.harkenscythe.HarkenScythe; +import net.minecraft.entity.EntityLivingBase; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +@Mod.EventBusSubscriber(modid = HarkenScythe.MOD_ID) +public class HSLivingDropsEvent +{ + @SubscribeEvent(priority = EventPriority.LOWEST) + public static void onLivingDrops(LivingDropsEvent event) + { + EntityLivingBase entity = event.getEntityLiving(); + // TODO: Set entity data to determine spectral variant + if (entity.getCustomNameTag().contains("Spectral")) + { + event.getDrops().clear(); + } + } +}