public interface IHackableEntity
IPneumaticHelmetRegistry.addHackable(Class, java.util.function.Supplier).
Either way, there will be an IHackableEntity instance for every entity.| Modifier and Type | Method and Description |
|---|---|
void |
addHackInfo(net.minecraft.entity.Entity entity,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
Add info that is displayed on the tracker tooltip here.
|
void |
addPostHackInfo(net.minecraft.entity.Entity entity,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true.
|
boolean |
afterHackTick(net.minecraft.entity.Entity entity)
Called every tick after the hacking finished.
|
boolean |
canHack(net.minecraft.entity.Entity entity,
net.minecraft.entity.player.PlayerEntity player)
Returning true will allow the player to hack this entity.
|
net.minecraft.util.ResourceLocation |
getHackableId()
Should return a unique id to represent this hackable.
|
int |
getHackTime(net.minecraft.entity.Entity entity,
net.minecraft.entity.player.PlayerEntity player)
Return the time it takes to hack this entity in ticks.
|
void |
onHackFinished(net.minecraft.entity.Entity entity,
net.minecraft.entity.player.PlayerEntity player)
Called when a player successfully hacks an entity; basically
getHackTime(Entity) ticks after the
hack was initiated. |
@Nullable net.minecraft.util.ResourceLocation getHackableId()
boolean canHack(net.minecraft.entity.Entity entity,
net.minecraft.entity.player.PlayerEntity player)
entity - the potential hacking targetplayer - the player who is looking at the entityvoid addHackInfo(net.minecraft.entity.Entity entity,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
entity - the potential hack targetcurInfo - a text component list to append info toplayer - the player who is looking at the entityvoid addPostHackInfo(net.minecraft.entity.Entity entity,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
entity - the hacked entitycurInfo - a text component list to append info toplayer - the player who has hacked the entityint getHackTime(net.minecraft.entity.Entity entity,
net.minecraft.entity.player.PlayerEntity player)
entity - the potential hack targetplayer - the player who is looking at the entityvoid onHackFinished(net.minecraft.entity.Entity entity,
net.minecraft.entity.player.PlayerEntity player)
getHackTime(Entity) ticks after the
hack was initiated.entity - the hacked entityplayer - the player who has hacked the entityboolean afterHackTick(net.minecraft.entity.Entity entity)
entity - the hacked entity