Package net.minecraft.server

Examples of net.minecraft.server.DamageSource


   * @param entity to be damaged
   * @param damager that damages
   * @param damage to deal
   */
  public static void damageBy(org.bukkit.entity.Entity entity, org.bukkit.entity.Entity damager, double damage) {
    DamageSource source;
    if (damager instanceof Player) {
      source = DamageSource.playerAttack(CommonNMS.getNative((Player) damager));
    } else if (damager instanceof LivingEntity) {
      source = DamageSource.mobAttack(CommonNMS.getNative((LivingEntity) damager));
    } else {
View Full Code Here


   * @param entity to be damagedd
   * @param cause of the damage
   * @param damage to deal
   */
  public static void damage(org.bukkit.entity.Entity entity, DamageCause cause, double damage) {
    DamageSource source;
    if (cause == DamageCause.BLOCK_EXPLOSION) {
      Location loc = entity.getLocation();
      World worldhandle = CommonNMS.getNative(loc.getWorld());
      Explosion ex = new Explosion(worldhandle, null, loc.getX(), loc.getY(), loc.getZ(), (float) 4.0);
      source = DamageSource.explosion(ex);
View Full Code Here

TOP

Related Classes of net.minecraft.server.DamageSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.