pathc someyihng AGIAJNNN
This commit is contained in:
		
					parent
					
						
							
								3b8f2a6cd7
							
						
					
				
			
			
				commit
				
					
						b12084c9f6
					
				
			
		
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -20,7 +20,9 @@ import org.bukkit.entity.LivingEntity; | |||
| import org.bukkit.entity.Player; | ||||
| import org.bukkit.event.EventHandler; | ||||
| import org.bukkit.event.Listener; | ||||
| import org.bukkit.event.entity.EntityDamageByEntityEvent; | ||||
| import org.bukkit.event.entity.EntitySpawnEvent; | ||||
| import org.bukkit.metadata.MetadataValue; | ||||
| import org.bukkit.plugin.java.JavaPlugin; | ||||
| import org.bukkit.potion.PotionEffect; | ||||
| import org.bukkit.potion.PotionEffectType; | ||||
|  | @ -114,6 +116,15 @@ public class Main extends JavaPlugin implements Listener { | |||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@EventHandler | ||||
| 	public void entityDamage(EntityDamageByEntityEvent e) { | ||||
| 		LivingEntity damager = (LivingEntity) e.getDamager(); | ||||
| 		if (damager.getType() == EntityType.HUSK && damager.getCustomName() == "Giant") { | ||||
| 			damager.setHealth(0); | ||||
| 			e.setCancelled(true); | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	Entity spawnGiant(boolean ai, Location pos) { | ||||
| 		LivingEntity entity = (LivingEntity) pos.getWorld().spawnEntity(pos, EntityType.GIANT); | ||||
| 		if (ai) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Minecon724
				Minecon724