use of org.bukkit.entity.WitherSkeleton in project BentoBox by BentoBoxWorld.
the class TNTListenerTest method testOnTNTDamageInWorldTNTProjectileWitherSkelly.
@Test
public void testOnTNTDamageInWorldTNTProjectileWitherSkelly() {
// Block on fire
when(block.getType()).thenReturn(Material.TNT);
// Entity is a projectile
// Entity is an arrow
Arrow arrow = mock(Arrow.class);
// Shooter is a skeleton
WitherSkeleton skeleton = mock(WitherSkeleton.class);
when(arrow.getShooter()).thenReturn(skeleton);
// Fire arrow
when(arrow.getFireTicks()).thenReturn(10);
EntityChangeBlockEvent e = new EntityChangeBlockEvent(arrow, block, Material.AIR.createBlockData());
listener.onTNTDamage(e);
assertFalse(e.isCancelled());
verify(arrow, never()).remove();
}
Aggregations