Class HackableGuardian
java.lang.Object
me.desht.pneumaticcraft.api.pneumatic_armor.hacking.AbstractPersistentEntityHack<net.minecraft.world.entity.monster.Guardian>
me.desht.pneumaticcraft.common.hacking.entity.HackableGuardian
- All Implemented Interfaces:
IHackableEntity<net.minecraft.world.entity.monster.Guardian>
public class HackableGuardian
extends AbstractPersistentEntityHack<net.minecraft.world.entity.monster.Guardian>
-
Nested Class Summary
Nested classes/interfaces inherited from class me.desht.pneumaticcraft.api.pneumatic_armor.hacking.AbstractPersistentEntityHack
AbstractPersistentEntityHack.StockHackTypes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanafterHackTick(net.minecraft.world.entity.monster.Guardian entity) Called every tick after the hack completed.@NotNull Class<net.minecraft.world.entity.monster.Guardian>Get the class of the entity this hack should apply to.net.minecraft.resources.ResourceLocationShould return a unique id to represent this hackable.voidonHackFinished(net.minecraft.world.entity.monster.Guardian 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.api.pneumatic_armor.hacking.AbstractPersistentEntityHack
addHackInfo, addPostHackInfo, canHack, getHackTime, hasPersistentHackMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.api.pneumatic_armor.hacking.IHackableEntity
_addHackInfo, _addPostHackInfo, _afterHackTick, _getHackTime, _onHackFinished
-
Constructor Details
-
HackableGuardian
public HackableGuardian()
-
-
Method Details
-
getHackableId
public net.minecraft.resources.ResourceLocation getHackableId()Description copied from interface:IHackableEntityShould return a unique id to represent this hackable.- Returns:
- a unique String id
-
getHackableClass
Description copied from interface:IHackableEntityGet the class of the entity this hack should apply to. All subclasses of this class will also be applicable.- Returns:
- the target entity class
-
onHackFinished
public void onHackFinished(net.minecraft.world.entity.monster.Guardian 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<net.minecraft.world.entity.monster.Guardian>- Overrides:
onHackFinishedin classAbstractPersistentEntityHack<net.minecraft.world.entity.monster.Guardian>- Parameters:
entity- the hacked entityplayer- the player who has hacked the entity
-
afterHackTick
public boolean afterHackTick(net.minecraft.world.entity.monster.Guardian entity) Description copied from interface:IHackableEntityCalled every tick after the hack completed. Return false for one-shot hacks, or true to keep this hack ticking. The majority of hacks are one-shot; see alsoAbstractPersistentEntityHackfor a class to use for persistent hacks.Dead or otherwise removed entities will automatically be removed from the after-hack tick list.
- Specified by:
afterHackTickin interfaceIHackableEntity<net.minecraft.world.entity.monster.Guardian>- Overrides:
afterHackTickin classAbstractPersistentEntityHack<net.minecraft.world.entity.monster.Guardian>- Parameters:
entity- the hacked entity- Returns:
- true to keep having this method called each tick for the entity, false to stop ticking
-