• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Entity "avancé"

    Sans suite
    1.7.10
    4
    8
    1831
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Yorwan
      Yorwan last edited by

      Bonjour ,
      aujourd’hui je ne vous casserai pas les pied avec un bug a la noix pour la simple et bonne raison qu’il n’y en a pas , en fait j’ai besoin d’un aide par rapport a des fonctions que je ne connais pas . J’ai crée une créature et tout vas bien elle spawn et tout seulement j’aimerai quel reste sur place sans bouger , et quelle bouge avec une fonction par exemple onHurt(…) { … this.faireBouger(x,y,z) ; } ou autre , a oui et changer ses bruit quand elle meurt et tout .
      merci de votre attention et de votre réponse

      1 Reply Last reply Reply Quote 0
      • BrokenSwing
        BrokenSwing Moddeurs confirmés Rédacteurs last edited by

        Un :

        this.setNoAI(true);
        

        Devrait suffire pour éviter qu’elle bouge seule je pense

        1 Reply Last reply Reply Quote 0
        • Antoine_
          Antoine_ last edited by

          @‘Asmath’:

          Bonjour ,
          aujourd’hui je ne vous casserai pas les pied avec un bug a la noix pour la simple et bonne raison qu’il n’y en a pas , en fait j’ai besoin d’un aide par rapport a des fonctions que je ne connais pas . J’ai crée une créature et tout vas bien elle spawn et tout seulement j’aimerai quel reste sur place sans bouger , et quelle bouge avec une fonction par exemple onHurt(…) { … this.faireBouger(x,y,z) ; } ou autre , a oui et changer ses bruit quand elle meurt et tout .
          merci de votre attention et de votre réponse

          Si tu es en 1.7.10 moi j’utilise ceci pour que mon mob ne bouge pas:

          public void onLivingUpdate()
          {
                 if (this.newPosRotationIncrements > 0)
                 {
                     double d0 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements;
                     double d1 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements;
                     double d2 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements;
                     double d3 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw);
                     this.rotationYaw = (float)((double)this.rotationYaw + d3 / (double)this.newPosRotationIncrements);
                     this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements);
                     –this.newPosRotationIncrements;
                     this.setPosition(d0, d1, d2);
                     this.setRotation(this.rotationYaw, this.rotationPitch);
                 }
                 else if (!this.isClientWorld())
                 {
                     this.motionX *= 0.98D;
                     this.motionY *= 0.98D;
                     this.motionZ *= 0.98D;
                 }
          
                 if (Math.abs(this.motionX) < 0.005D)
                 {
                     this.motionX = 0.0D;
                 }
          
                 if (Math.abs(this.motionY) < 0.005D)
                 {
                     this.motionY = 0.0D;
                 }
          
                 if (Math.abs(this.motionZ) < 0.005D)
                 {
                     this.motionZ = 0.0D;
                 }
          
                 this.worldObj.theProfiler.startSection("ai");
          
                 if (this.isMovementBlocked())
                 {
                     this.isJumping = false;
                     this.moveStrafing = 0.0F;
                     this.moveForward = 0.0F;
                     this.randomYawVelocity = 0.0F;
                 }
                 else if (this.isClientWorld())
                 {
                     if (this.isAIEnabled())
                     {
                         this.worldObj.theProfiler.startSection("newAi");
                         this.updateAITasks();
                         this.worldObj.theProfiler.endSection();
                     }
                     else
                     {
                         this.worldObj.theProfiler.startSection("oldAi");
                         this.updateEntityActionState();
                         this.worldObj.theProfiler.endSection();
                         this.rotationYawHead = this.rotationYaw;
                     }
                 }
          
                 this.worldObj.theProfiler.endSection();
                 this.worldObj.theProfiler.startSection("jump");
          
                 if (this.isJumping)
                 {
                     if (!this.isInWater() && !this.handleLavaMovement())
                     {
                         if (this.onGround)
                         {
                             this.jump();
                         }
                     }
                     else
                     {
                         this.motionY += 0.03999999910593033D;
                     }
                 }
          
                 this.worldObj.theProfiler.endSection();
                 this.worldObj.theProfiler.startSection("travel");
                 this.moveStrafing *= 0.98F;
                 this.moveForward *= 0.98F;
                 this.randomYawVelocity *= 0.9F;
                 this.worldObj.theProfiler.endSection();
                 this.worldObj.theProfiler.startSection("push");
          
                 if (!this.worldObj.isRemote)
                 {
                     this.collideWithNearbyEntities();
                 }
          
                 this.worldObj.theProfiler.endSection();
             }
          

          Après pour les sons

          public String getHurtSound()
           {
             return "tuto:son1";
           }
          
           public String getDeathSound()
           {
             return "tuto:son2";
           }
          
           public String getLivingSound()
           {
             return "tuto:son3";
           }
          
          1 Reply Last reply Reply Quote 0
          • Yorwan
            Yorwan last edited by

            bah étant donné que c’est fonction n’existe pas. …

            1 Reply Last reply Reply Quote 0
            • BrokenSwing
              BrokenSwing Moddeurs confirmés Rédacteurs last edited by

              Bah étant donné que que tu n’as pas donné ta version de forge …

              1 Reply Last reply Reply Quote 0
              • robin4002
                robin4002 Moddeurs confirmés Rédacteurs Administrateurs last edited by

                En effet en plus c’est écrit dans le règlement de la section. Toujours mettre la balise de version.

                1 Reply Last reply Reply Quote 0
                • Yorwan
                  Yorwan last edited by

                  a oui effectivement je vais modifier le sujet j’ai oublié

                  1 Reply Last reply Reply Quote 0
                  • Antoine_
                    Antoine_ last edited by

                    envoie la classe de ton entité 😃 je vais voir ce que je peux faire.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Design by Woryk
                    Contact / Mentions Légales

                    MINECRAFT FORGE FRANCE © 2018

                    Powered by NodeBB