Search in sources :

Example 1 with Raider

use of net.minecraft.world.entity.raid.Raider in project Supplementaries by MehVahdJukaar.

the class RedMerchantEntity method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(0, new FloatGoal(this));
    this.goalSelector.addGoal(2, new EquipAndRangeAttackGoal(this, 0.35D, 60, 10, 20, 15, new ItemStack(ModRegistry.BOMB_ITEM.get())));
    this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Mob.class, 8, true, false, (mob) -> (mob instanceof Raider || mob instanceof Zombie || mob instanceof Zoglin)));
    this.goalSelector.addGoal(3, new TradeWithPlayerGoal(this));
    this.goalSelector.addGoal(3, new LookAtTradingPlayerGoal(this));
    this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Zombie.class, 6.0F, 0.5D, 0.5D));
    this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Vex.class, 8.0F, 0.5D, 0.5D));
    this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creeper.class, 8.0F, 0.5D, 0.5D));
    this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Raider.class, 11.0F, 0.5D, 0.5D));
    this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Zoglin.class, 8.0F, 0.5D, 0.5D));
    this.goalSelector.addGoal(4, new ShowWaresGoal(this, 400, 1600));
    this.goalSelector.addGoal(4, new RedMerchantEntity.MoveToGoal(this, 2.0D, 0.35D));
    this.goalSelector.addGoal(5, new MoveTowardsRestrictionGoal(this, 0.35D));
    this.goalSelector.addGoal(8, new WaterAvoidingRandomStrollGoal(this, 0.35D));
    // this.goalSelector.addGoal(9, new LookAtWithoutMovingGoal(this, PlayerEntity.class, 3.0F, 1.0F));
    this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F));
}
Also used : Items(net.minecraft.world.item.Items) MerchantOffers(net.minecraft.world.item.trading.MerchantOffers) ClientBoundSyncTradesPacket(net.mehvahdjukaar.supplementaries.common.network.ClientBoundSyncTradesPacket) net.minecraft.world.entity.ai.goal(net.minecraft.world.entity.ai.goal) Item(net.minecraft.world.item.Item) AbstractVillager(net.minecraft.world.entity.npc.AbstractVillager) SimpleMenuProvider(net.minecraft.world.SimpleMenuProvider) ServerLevel(net.minecraft.server.level.ServerLevel) OptionalInt(java.util.OptionalInt) RedMerchantContainerMenu(net.mehvahdjukaar.supplementaries.common.inventories.RedMerchantContainerMenu) VillagerTradesHandler(net.mehvahdjukaar.supplementaries.common.entities.trades.VillagerTradesHandler) ServerPlayer(net.minecraft.server.level.ServerPlayer) Raider(net.minecraft.world.entity.raid.Raider) DamageSource(net.minecraft.world.damagesource.DamageSource) PacketDistributor(net.minecraftforge.network.PacketDistributor) NearestAttackableTargetGoal(net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal) SoundEvents(net.minecraft.sounds.SoundEvents) Stats(net.minecraft.stats.Stats) MerchantOffer(net.minecraft.world.item.trading.MerchantOffer) net.minecraft.world.entity(net.minecraft.world.entity) Nullable(javax.annotation.Nullable) EnumSet(java.util.EnumSet) NbtUtils(net.minecraft.nbt.NbtUtils) Component(net.minecraft.network.chat.Component) InteractionResult(net.minecraft.world.InteractionResult) ShowWaresGoal(net.mehvahdjukaar.supplementaries.common.entities.goals.ShowWaresGoal) NetworkHandler(net.mehvahdjukaar.supplementaries.common.network.NetworkHandler) Player(net.minecraft.world.entity.player.Player) net.minecraft.world.entity.monster(net.minecraft.world.entity.monster) CompoundTag(net.minecraft.nbt.CompoundTag) BlockPos(net.minecraft.core.BlockPos) SoundEvent(net.minecraft.sounds.SoundEvent) Vec3(net.minecraft.world.phys.Vec3) EquipAndRangeAttackGoal(net.mehvahdjukaar.supplementaries.common.entities.goals.EquipAndRangeAttackGoal) ModRegistry(net.mehvahdjukaar.supplementaries.setup.ModRegistry) Packet(net.minecraft.network.protocol.Packet) InteractionHand(net.minecraft.world.InteractionHand) ItemStack(net.minecraft.world.item.ItemStack) Level(net.minecraft.world.level.Level) Mth(net.minecraft.util.Mth) NetworkHooks(net.minecraftforge.network.NetworkHooks) EquipAndRangeAttackGoal(net.mehvahdjukaar.supplementaries.common.entities.goals.EquipAndRangeAttackGoal) Raider(net.minecraft.world.entity.raid.Raider) ShowWaresGoal(net.mehvahdjukaar.supplementaries.common.entities.goals.ShowWaresGoal) ItemStack(net.minecraft.world.item.ItemStack)

Example 2 with Raider

use of net.minecraft.world.entity.raid.Raider in project Mohist by MohistMC.

the class CraftEventFactory method callRaidSpawnWaveEvent.

public static void callRaidSpawnWaveEvent(Raid raid, Raider leader, List<Raider> raiders) {
    org.bukkit.entity.Raider craftLeader = (CraftRaider) leader.getBukkitEntity();
    List<org.bukkit.entity.Raider> craftRaiders = new ArrayList<>();
    for (Raider entityRaider : raiders) {
        craftRaiders.add((org.bukkit.entity.Raider) entityRaider.getBukkitEntity());
    }
    RaidSpawnWaveEvent event = new RaidSpawnWaveEvent(new CraftRaid(raid), raid.getLevel().getWorld(), craftLeader, craftRaiders);
    Bukkit.getPluginManager().callEvent(event);
}
Also used : Raider(net.minecraft.world.entity.raid.Raider) CraftRaider(org.bukkit.craftbukkit.v1_18_R2.entity.CraftRaider) ArrayList(java.util.ArrayList) RaidSpawnWaveEvent(org.bukkit.event.raid.RaidSpawnWaveEvent) CraftRaider(org.bukkit.craftbukkit.v1_18_R2.entity.CraftRaider)

Aggregations

Raider (net.minecraft.world.entity.raid.Raider)2 ArrayList (java.util.ArrayList)1 EnumSet (java.util.EnumSet)1 OptionalInt (java.util.OptionalInt)1 Nullable (javax.annotation.Nullable)1 EquipAndRangeAttackGoal (net.mehvahdjukaar.supplementaries.common.entities.goals.EquipAndRangeAttackGoal)1 ShowWaresGoal (net.mehvahdjukaar.supplementaries.common.entities.goals.ShowWaresGoal)1 VillagerTradesHandler (net.mehvahdjukaar.supplementaries.common.entities.trades.VillagerTradesHandler)1 RedMerchantContainerMenu (net.mehvahdjukaar.supplementaries.common.inventories.RedMerchantContainerMenu)1 ClientBoundSyncTradesPacket (net.mehvahdjukaar.supplementaries.common.network.ClientBoundSyncTradesPacket)1 NetworkHandler (net.mehvahdjukaar.supplementaries.common.network.NetworkHandler)1 ModRegistry (net.mehvahdjukaar.supplementaries.setup.ModRegistry)1 BlockPos (net.minecraft.core.BlockPos)1 CompoundTag (net.minecraft.nbt.CompoundTag)1 NbtUtils (net.minecraft.nbt.NbtUtils)1 Component (net.minecraft.network.chat.Component)1 Packet (net.minecraft.network.protocol.Packet)1 ServerLevel (net.minecraft.server.level.ServerLevel)1 ServerPlayer (net.minecraft.server.level.ServerPlayer)1 SoundEvent (net.minecraft.sounds.SoundEvent)1