Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import crafttweaker.event.EntityLivingSpawnEvent;
- import crafttweaker.item.IItemStack;
- import crafttweaker.entity.IEntityLivingBase;
- import crafttweaker.entity.IEntityDefinition;
- import crafttweaker.entity.IEntityLiving;
- import scripts.mob_spawn_statics as stats;
- /* events.onSpecialSpawn (function(event as EntityLivingSpawnEvent)
- {
- print("In onSpecialSpawn");
- if (event.entityLivingBase.world.isRemote() || isNull(event.entityLivingBase.definition) || (!(event.entityLivingBase instanceof IEntityLiving))) { return; }
- if (stats.alwaysCanPickUp has event.entityLivingBase.definition.id)
- {
- print("setting canPickUpLoot loot in onSpecialSpawn");
- val entityLiving as IEntityLiving = event.entityLivingBase;
- entityLiving.canPickUpLoot = true;
- }
- }); */
- events.onCheckSpawn (function(event as EntityLivingSpawnEvent)
- {
- print("In onCheckSpawn");
- if (event.entityLivingBase.world.isRemote() || isNull(event.entityLivingBase.definition) || (!(event.entityLivingBase instanceof IEntityLiving))) { return; }
- print("onCheckSpawn continuing");
- if (!isNull(event.entityLivingBase.definition))// &&
- {
- print("!isNull(event.entityLivingBase.definition)");
- if (!isNull(event.entityLivingBase.definition.id))// &&
- {
- print("!isNull(event.entityLivingBase.definition.id)");
- print("id: "~event.entityLivingBase.definition.id);
- if ((stats.alwaysCanPickUp has event.entityLivingBase.definition.id))
- {
- print("Declaring entityLiving");
- val entityLiving as IEntityLiving = event.entityLivingBase;
- print("Declaration complete, setting canPickUpLoot loot in onCheckSpawn");
- entityLiving.canPickUpLoot = true;
- }
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement