MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Armes et munitions

    Planifier Épinglé Verrouillé Déplacé Résolu 1.9.x et 1.10.x
    1.10.x
    2 Messages 2 Publieurs 700 Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • AzTick_A Hors-ligne
      AzTick_
      dernière édition par

      Bonjour,

      J’ai un petit problème, je vient de développer une armes avec des munitions et quand je tire avec l’arme, j’ai une erreur console que je ne comprend pas vraiment :

      Caused by: java.lang.NoSuchMethodException: fr.askip.combinecity.entity.Bullet.<init>(net.minecraft.world.World)
      at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.8.0_161]
      at java.lang.Class.getConstructor(Unknown Source) ~[?:1.8.0_161]
      at net.minecraftforge.fml.common.network.internal.EntitySpawnHandler.spawnEntity(EntitySpawnHandler.java:96) ~[EntitySpawnHandler.class:?]
      at net.minecraftforge.fml.common.network.internal.EntitySpawnHandler.process(EntitySpawnHandler.java:73) ~[EntitySpawnHandler.class:?]
      at net.minecraftforge.fml.common.network.internal.EntitySpawnHandler.access$000(EntitySpawnHandler.java:48) ~[EntitySpawnHandler.class:?]
      at net.minecraftforge.fml.common.network.internal.EntitySpawnHandler$1.run(EntitySpawnHandler.java:63) ~[EntitySpawnHandler$1.class:?]
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_161]
      at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_161]
      at net.minecraft.util.Util.runTask(Util.java:28) ~[Util.class:?]
      … 15 more
      

      Je sais que c’est dans la classe Bullet donc je vous la file :

      public class Bullet extends EntityFireball {
      
      public int damage = 0;
      
      public Bullet(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ, int damage) {
      super(worldIn, shooter, accelX, accelY, accelZ);
      this.damage = damage;
      double d0 = (double) MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ);
      this.accelerationX = accelX * 40 / d0 * 0.1D;
      this.accelerationY = accelY * 40 / d0 * 0.1D;
      this.accelerationZ = accelZ * 40 / d0 * 0.1D;
      this.setSize(0.15F, 0.15F);
      }
      
      @Override
      protected void onImpact(RayTraceResult result) {
      if (!this.worldObj.isRemote) {
      if (result.entityHit != null && this.shootingEntity != null) {
      result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), damage);
      this.applyEnchantments(this.shootingEntity, result.entityHit);
      }
      if (result.typeOfHit == RayTraceResult.Type.BLOCK && this.shootingEntity != null) {
      System.out.println("");
      if (this.shootingEntity.worldObj.rand.nextInt(2) == 0) {
      Main.network.sendToAllAround(new PacketSounds(84),
      new NetworkRegistry.TargetPoint(shootingEntity.dimension, shootingEntity.posX,
      shootingEntity.posY, shootingEntity.posZ, 10));
      }
      }
      this.setDead();
      }
      }
      
      }
      

      Merci d’avance :)</init>

      1 réponse Dernière réponse Répondre Citer 0
      • robin4002R Hors-ligne
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
        dernière édition par

        Salut,
        Les entités ont besoin d’un constructeur avec juste world comme argument, il est utilisé pour faire spawn l’entité sur le world client lorsqu’il reçoit un paquet de spawn d’entité.

        1 réponse Dernière réponse Répondre Citer 0
        • 1 / 1
        • Premier message
          Dernier message
        Design by Woryk
        ContactMentions Légales

        MINECRAFT FORGE FRANCE © 2024

        Powered by NodeBB