Class MinionDataHolder

java.lang.Object
com.binaris.wizardry.cca.entity.MinionDataHolder
All Implemented Interfaces:
MinionData, dev.onyxstudios.cca.api.v3.component.Component, dev.onyxstudios.cca.api.v3.component.ComponentV3, dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent, dev.onyxstudios.cca.api.v3.component.sync.ComponentPacketWriter, dev.onyxstudios.cca.api.v3.component.sync.PlayerSyncPredicate

public class MinionDataHolder extends Object implements MinionData, dev.onyxstudios.cca.api.v3.component.ComponentV3, dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent
  • Constructor Summary

    Constructors
    Constructor
    Description
    MinionDataHolder(net.minecraft.world.entity.Mob provider)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the lifetime of the minion in ticks.
    @Nullable net.minecraft.world.entity.LivingEntity
    Gets the owner entity of the minion.
    Gets the UUID of the owner of the minion.
    net.minecraft.world.entity.Mob
    Gets the mob that this minion data is associated with.
    boolean
    Determines whether the minion's original goals should be restarted, this is used when the minion's tick method is called after it has been loaded into the world.
    boolean
    Decreases the minion's lifetime by one tick.
    void
    markGoalRestart(boolean shouldRestartGoals)
    Sets whether the minion's original goals should be restarted, this is used when the minion's tick method is called after it has been loaded into the world.
    void
    readFromNbt(@NotNull net.minecraft.nbt.CompoundTag tag)
     
    boolean
    Determines if the minion should search nearby mobs that can attack the owner and target them.
    void
    setLifetime(int lifetime)
    Sets the lifetime of the minion in ticks.
    void
    setOwner(net.minecraft.world.entity.LivingEntity owner)
    Sets the owner entity of the minion.
    void
    setOwnerUUID(UUID ownerUUID)
    Sets the UUID of the owner of the minion.
    void
    setSearchNearbyTargets(boolean searchNearbyTargets)
    Sets whether the minion should search nearby mobs that can represent a danger to the owner and target them.
    void
    setShouldDeleteGoals(boolean shouldDeleteGoals)
    Sets whether the minion's goals should be deleted when the minion is created.
    void
    setShouldFollowOwner(boolean shouldFollowOwner)
    Sets whether the minion should follow its owner.
    void
    setSummoned(boolean summoned)
    Sets whether the minion was summoned by a player.
    boolean
    Determines whether the minion's goals should be deleted when the minion is created.
    boolean
    Determines whether the minion should follow its owner.
    void
     
    void
    Called every tick to update the minion's state, including checking its lifetime and spawning particles.
    void
    writeToNbt(net.minecraft.nbt.CompoundTag tag)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent

    applySyncPacket, shouldSyncWith, writeSyncPacket

    Methods inherited from interface dev.onyxstudios.cca.api.v3.component.Component

    equals

    Methods inherited from interface com.binaris.wizardry.api.content.data.MinionData

    updateGoals
  • Constructor Details

    • MinionDataHolder

      public MinionDataHolder(net.minecraft.world.entity.Mob provider)
  • Method Details

    • sync

      public void sync()
    • getProvider

      public net.minecraft.world.entity.Mob getProvider()
      Description copied from interface: MinionData
      Gets the mob that this minion data is associated with. Normally you won't need to use this method directly.
      Specified by:
      getProvider in interface MinionData
      Returns:
      the mob provider
    • tick

      public void tick()
      Description copied from interface: MinionData
      Called every tick to update the minion's state, including checking its lifetime and spawning particles.
      Specified by:
      tick in interface MinionData
    • getLifetime

      public int getLifetime()
      Description copied from interface: MinionData
      Gets the lifetime of the minion in ticks.
      Specified by:
      getLifetime in interface MinionData
      Returns:
      the lifetime of the minion
    • setLifetime

      public void setLifetime(int lifetime)
      Description copied from interface: MinionData
      Sets the lifetime of the minion in ticks.
      Specified by:
      setLifetime in interface MinionData
      Parameters:
      lifetime - the new lifetime of the minion
    • isSummoned

      public boolean isSummoned()
      Description copied from interface: MinionData
      Decreases the minion's lifetime by one tick.
      Specified by:
      isSummoned in interface MinionData
    • setSummoned

      public void setSummoned(boolean summoned)
      Description copied from interface: MinionData
      Sets whether the minion was summoned by a player.
      Specified by:
      setSummoned in interface MinionData
      Parameters:
      summoned - true if the minion was summoned, false otherwise
    • shouldDeleteGoals

      public boolean shouldDeleteGoals()
      Description copied from interface: MinionData
      Determines whether the minion's goals should be deleted when the minion is created.
      Specified by:
      shouldDeleteGoals in interface MinionData
      Returns:
      true if the goals should be deleted, false otherwise
    • setShouldDeleteGoals

      public void setShouldDeleteGoals(boolean shouldDeleteGoals)
      Description copied from interface: MinionData
      Sets whether the minion's goals should be deleted when the minion is created.
      Specified by:
      setShouldDeleteGoals in interface MinionData
      Parameters:
      shouldDeleteGoals - true to delete the goals, false otherwise
    • shouldFollowOwner

      public boolean shouldFollowOwner()
      Description copied from interface: MinionData
      Determines whether the minion should follow its owner.
      Specified by:
      shouldFollowOwner in interface MinionData
      Returns:
      true if the minion should follow its owner, false otherwise
    • setShouldFollowOwner

      public void setShouldFollowOwner(boolean shouldFollowOwner)
      Description copied from interface: MinionData
      Sets whether the minion should follow its owner.
      Specified by:
      setShouldFollowOwner in interface MinionData
      Parameters:
      shouldFollowOwner - true if the minion should follow its owner, false otherwise
    • searchNearbyTargets

      public boolean searchNearbyTargets()
      Description copied from interface: MinionData
      Determines if the minion should search nearby mobs that can attack the owner and target them. (This avoids attacking allies minions and passive mobs!)
      Specified by:
      searchNearbyTargets in interface MinionData
      Returns:
      true if the minion should search and target nearby mobs based on the target conditions, false otherwise
    • setSearchNearbyTargets

      public void setSearchNearbyTargets(boolean searchNearbyTargets)
      Description copied from interface: MinionData
      Sets whether the minion should search nearby mobs that can represent a danger to the owner and target them.
      Specified by:
      setSearchNearbyTargets in interface MinionData
      Parameters:
      searchNearbyTargets - true if the minion should search and target nearby mobs based on the target conditions, false otherwise
    • getOwnerUUID

      public UUID getOwnerUUID()
      Description copied from interface: MinionData
      Gets the UUID of the owner of the minion.
      Specified by:
      getOwnerUUID in interface MinionData
      Returns:
      the owner's UUID
    • setOwnerUUID

      public void setOwnerUUID(UUID ownerUUID)
      Description copied from interface: MinionData
      Sets the UUID of the owner of the minion.
      Specified by:
      setOwnerUUID in interface MinionData
      Parameters:
      ownerUUID - the owner's UUID
    • getOwner

      @Nullable public @Nullable net.minecraft.world.entity.LivingEntity getOwner()
      Description copied from interface: MinionData
      Gets the owner entity of the minion.
      Specified by:
      getOwner in interface MinionData
      Returns:
      the owner entity
    • setOwner

      public void setOwner(net.minecraft.world.entity.LivingEntity owner)
      Description copied from interface: MinionData
      Sets the owner entity of the minion.
      Specified by:
      setOwner in interface MinionData
      Parameters:
      owner - the owner entity
    • markGoalRestart

      public void markGoalRestart(boolean shouldRestartGoals)
      Description copied from interface: MinionData
      Sets whether the minion's original goals should be restarted, this is used when the minion's tick method is called after it has been loaded into the world.

      Note: This method is intended for internal use only and should not be called directly or overridden.

      Specified by:
      markGoalRestart in interface MinionData
      Parameters:
      shouldRestartGoals - true to restart the goals, false otherwise
    • goalRestart

      public boolean goalRestart()
      Description copied from interface: MinionData
      Determines whether the minion's original goals should be restarted, this is used when the minion's tick method is called after it has been loaded into the world.

      Note: This method is intended for internal use only and should not be called directly or overridden.

      Specified by:
      goalRestart in interface MinionData
      Returns:
      true if the goals should be restarted, false otherwise
    • readFromNbt

      public void readFromNbt(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag)
      Specified by:
      readFromNbt in interface dev.onyxstudios.cca.api.v3.component.Component
    • writeToNbt

      public void writeToNbt(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      writeToNbt in interface dev.onyxstudios.cca.api.v3.component.Component