Хостинг серверов Minecraft playvds.com
  1. Этот сайт использует файлы cookie. Продолжая пользоваться данным сайтом, Вы соглашаетесь на использование нами Ваших файлов cookie. Узнать больше.
  2. Вы находитесь в русском сообществе Bukkit. Мы - администраторы серверов Minecraft, разрабатываем собственные плагины и переводим на русский язык плагины наших собратьев из других стран.
    Скрыть объявление

Помогите Помогите с мобом на прыжок

Тема в разделе "Разработка плагинов для новичков", создана пользователем zalc, 4 ноя 2019.

  1. Автор темы
    zalc

    zalc Участник

    Баллы:
    31
    Имя в Minecraft:
    see1
    Проблема в том что моб когда на него сижу и нажимаю пробел он прыгает
    Мне эту функцию надо убрать
    Вот сам моб

    public class TransPortSpeeder extends EntityZombie
    {
    public TransPortSpeeder(final World world) {
    super((net.minecraft.server.v1_8_R3.World)((CraftWorld)world).getHandle());
    this.setCustomName("§6Спидер");
    this.setCustomNameVisible(true);
    this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.0);
    final List goalB = (List)getPrivateField("b", PathfinderGoalSelector.class, this.goalSelector);
    goalB.clear();
    final List goalC = (List)getPrivateField("c", PathfinderGoalSelector.class, this.goalSelector);
    goalC.clear();
    final List targetB = (List)getPrivateField("b", PathfinderGoalSelector.class, this.targetSelector);
    targetB.clear();
    final List targetC = (List)getPrivateField("c", PathfinderGoalSelector.class, this.targetSelector);
    targetC.clear();
    this.setHealth(1.0E9f);
    this.goalSelector.a(0, (PathfinderGoal)new PathfinderGoalFloat((EntityInsentient)this));
    this.goalSelector.a(2, (PathfinderGoal)new PathfinderGoalMeleeAttack((EntityCreature)this, (Class)EntityIronGolem.class, 1.0, false));
    this.goalSelector.a(4, (PathfinderGoal)new PathfinderGoalMeleeAttack((EntityCreature)this, (Class)EntitySpider.class, 1.0, true));
    this.goalSelector.a(5, (PathfinderGoal)new PathfinderGoalMoveTowardsRestriction((EntityCreature)this, 1.0));
    this.goalSelector.a(6, (PathfinderGoal)new PathfinderGoalMoveThroughVillage((EntityCreature)this, 1.0, false));
    this.goalSelector.a(7, (PathfinderGoal)new PathfinderGoalRandomStroll((EntityCreature)this, 1.0));
    this.goalSelector.a(8, (PathfinderGoal)new PathfinderGoalLookAtPlayer((EntityInsentient)this, (Class)EntityHuman.class, 8.0f));
    this.goalSelector.a(8, (PathfinderGoal)new PathfinderGoalRandomLookaround((EntityInsentient)this));
    this.targetSelector.a(1, (PathfinderGoal)new PathfinderGoalHurtByTarget((EntityCreature)this, true, new Class[0]));
    this.targetSelector.a(2, (PathfinderGoal)new PathfinderGoalNearestAttackableTarget((EntityCreature)this, (Class)EntitySpider.class, 1, true, false, (Predicate)null));
    this.targetSelector.a(2, (PathfinderGoal)new PathfinderGoalNearestAttackableTarget((EntityCreature)this, (Class)EntityIronGolem.class, 10, false, true, (Predicate)null));
    final net.minecraft.server.v1_8_R3.ItemStack testSword = CraftItemStack.asNMSCopy(new ItemStack(Material.DRAGON_EGG));
    this.setEquipment(4, testSword);
    this.buff(this.bukkitEntity = this.getBukkitEntity());
    this.buff1(this.bukkitEntity = this.getBukkitEntity());
    }

    public void buff(final CraftEntity bukkitEntity) {
    final PotionEffectType type = PotionEffectType.INVISIBILITY;
    final PotionEffect effect = new PotionEffect(type, 999999999, 3, false, false);
    ((LivingEntity)bukkitEntity).addPotionEffect(effect);
    }
    public void buff1(final CraftEntity bukkitEntity) {
    final PotionEffectType type = PotionEffectType.JUMP;
    final PotionEffect effect = new PotionEffect(type, 0, 3, false, false);
    ((LivingEntity)bukkitEntity).addPotionEffect(effect);
    }

    public boolean damageEntity(final DamageSource source, final float a) {
    return source.getEntity() != this.passenger && source != DamageSource.STUCK && super.damageEntity(source, a);
    }

    public void m() {
    super.m();
    }

    public static Object getPrivateField(final String fieldName, final Class<PathfinderGoalSelector> clazz, final Object object) {
    Object o = null;
    try {
    final Field field = clazz.getDeclaredField(fieldName);
    field.setAccessible(true);
    o = field.get(object);
    }
    catch (NoSuchFieldException e) {
    e.printStackTrace();
    }
    catch (IllegalAccessException e2) {
    e2.printStackTrace();
    }
    return o;
    }

    public void g(float sideMot, float forMot) {
    if (this.passenger == null || !(this.passenger instanceof EntityHuman)) {
    super.g(sideMot, forMot);
    this.S = 0.5f;
    return;
    }
    final float yaw = this.passenger.yaw;
    this.yaw = yaw;
    this.lastYaw = yaw;
    this.pitch = this.passenger.pitch * 0.5f;
    this.setYawPitch(this.yaw, this.pitch);
    final float yaw2 = this.yaw;
    this.aI = yaw2;
    this.aK = yaw2;
    this.S = 1.0f;
    sideMot = ((EntityLiving)this.passenger).aZ * 0.5f;
    forMot = ((EntityLiving)this.passenger).ba;
    if (forMot <= 0.0f) {
    forMot *= 0.25f;
    }
    sideMot *= 1.75f;
    final float speed = 1.75f;
    this.k(1.75f);
    super.g(sideMot, forMot);
    try {
    Field jump = null;
    jump = EntityLiving.class.getDeclaredField("aY");
    jump.setAccessible(true);
    if (jump != null && this.onGround && jump.getBoolean(this.passenger)) {
    final double jumpHeight = 0.5;
    this.motY = 0.5;
    }
    }
    catch (Exception e) {
    e.printStackTrace();
    }
    }
    }
     
  2. Хостинг MineCraft
    <

Поделиться этой страницей