Class HackableHorse
java.lang.Object
me.desht.pneumaticcraft.common.hacking.entity.HackableTameable
me.desht.pneumaticcraft.common.hacking.entity.HackableHorse
- All Implemented Interfaces:
IHackableEntity
Horses, although tameable animals, don't extend TamableAnimal. Yay.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHack(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player) Returning true will allow the player to hack this entity.net.minecraft.resources.ResourceLocationShould return a unique id to represent this hackable.voidonHackFinished(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player) Called when a player successfully hacks an entity; basicallygetHackTime(Entity)ticks after the hack was initiated.Methods inherited from class me.desht.pneumaticcraft.common.hacking.entity.HackableTameable
addHackInfo, addPostHackInfo, afterHackTick, getHackTime
-
Constructor Details
-
HackableHorse
public HackableHorse()
-
-
Method Details
-
getHackableId
public net.minecraft.resources.ResourceLocation getHackableId()Description copied from interface:IHackableEntityShould return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime after a server restart. Null is a valid return: afterHackTick will not be triggered at all in that case.- Specified by:
getHackableIdin interfaceIHackableEntity- Overrides:
getHackableIdin classHackableTameable- Returns:
- a unique String id
-
canHack
public boolean canHack(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player) Description copied from interface:IHackableEntityReturning true will allow the player to hack this entity. This can be used to only allow hacking under certain conditions.- Specified by:
canHackin interfaceIHackableEntity- Overrides:
canHackin classHackableTameable- Parameters:
entity- the potential hacking targetplayer- the player who is looking at the entity
-
onHackFinished
public void onHackFinished(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player) Description copied from interface:IHackableEntityCalled when a player successfully hacks an entity; basicallygetHackTime(Entity)ticks after the hack was initiated.- Specified by:
onHackFinishedin interfaceIHackableEntity- Overrides:
onHackFinishedin classHackableTameable- Parameters:
entity- the hacked entityplayer- the player who has hacked the entity
-