
I redone where the items/blocsks are stored and how the configs are handled to clean up it and give space. You can change the config line to AWWayofTime if you want to keep the compatibility with old configs. Now you reference the blocks from the ModBlocks and Items from the ModItems.
34 lines
1 KiB
Java
34 lines
1 KiB
Java
package WayofTime.alchemicalWizardry.common;
|
|
|
|
import net.minecraft.entity.passive.EntityAnimal;
|
|
import net.minecraft.potion.Potion;
|
|
import net.minecraft.potion.PotionEffect;
|
|
import net.minecraftforge.event.ForgeSubscribe;
|
|
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
|
|
|
public class ModLivingDropsEvent {
|
|
public static double rand;
|
|
|
|
@ForgeSubscribe
|
|
public void onEntityDrop(LivingDropsEvent event)
|
|
{
|
|
if (event.source.getDamageType().equals("player"))
|
|
{
|
|
rand = Math.random();
|
|
|
|
if (!(event.entityLiving instanceof EntityAnimal))
|
|
{
|
|
PotionEffect effect = event.entityLiving.getActivePotionEffect(Potion.weakness);
|
|
|
|
if (effect != null)
|
|
{
|
|
if (effect.getAmplifier() >= 2)
|
|
if (rand < 0.50d)
|
|
{
|
|
event.entityLiving.dropItem(ModItems.weakBloodShard.itemID, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |