2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2020-07-02 17:49:11 +00:00
|
|
|
* Copyright (c) 2016-2020.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2013-03-23 16:59:06 +00:00
|
|
|
package net.minecraftforge.event.entity.living;
|
|
|
|
|
2018-06-11 01:12:46 +00:00
|
|
|
import net.minecraftforge.eventbus.api.Cancelable;
|
2019-05-23 23:02:15 +00:00
|
|
|
import net.minecraft.entity.LivingEntity;
|
2013-03-23 16:59:06 +00:00
|
|
|
|
|
|
|
/**
|
2016-11-17 00:05:41 +00:00
|
|
|
* Event for when an Enderman/Shulker teleports or an ender pearl is used. Can be used to either modify the target position, or cancel the teleport outright.
|
2013-03-23 16:59:06 +00:00
|
|
|
* @author Mithion
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
@Cancelable
|
2013-03-23 20:56:01 +00:00
|
|
|
public class EnderTeleportEvent extends LivingEvent
|
|
|
|
{
|
|
|
|
|
2016-03-24 08:44:52 +00:00
|
|
|
private double targetX;
|
|
|
|
private double targetY;
|
|
|
|
private double targetZ;
|
|
|
|
private float attackDamage;
|
2013-03-23 20:56:01 +00:00
|
|
|
|
2019-05-23 23:02:15 +00:00
|
|
|
public EnderTeleportEvent(LivingEntity entity, double targetX, double targetY, double targetZ, float attackDamage)
|
2013-03-23 16:59:06 +00:00
|
|
|
{
|
|
|
|
super(entity);
|
2016-03-24 08:44:52 +00:00
|
|
|
this.setTargetX(targetX);
|
|
|
|
this.setTargetY(targetY);
|
|
|
|
this.setTargetZ(targetZ);
|
|
|
|
this.setAttackDamage(attackDamage);
|
2013-03-23 20:56:01 +00:00
|
|
|
}
|
2016-03-24 08:44:52 +00:00
|
|
|
|
|
|
|
public double getTargetX() { return targetX; }
|
|
|
|
public void setTargetX(double targetX) { this.targetX = targetX; }
|
|
|
|
public double getTargetY() { return targetY; }
|
|
|
|
public void setTargetY(double targetY) { this.targetY = targetY; }
|
|
|
|
public double getTargetZ() { return targetZ; }
|
|
|
|
public void setTargetZ(double targetZ) { this.targetZ = targetZ; }
|
|
|
|
public float getAttackDamage() { return attackDamage; }
|
|
|
|
public void setAttackDamage(float attackDamage) { this.attackDamage = attackDamage; }
|
2013-03-23 16:59:06 +00:00
|
|
|
}
|