Jump to content

troublemaker_47

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by troublemaker_47

  1. Hello, I am a beginner minecraft modder and i have some problems with a bit of code that would teleport the player in the direction he's facing.can anyone tell me How to merge these lines together: player.getLookVec().scale(2.0F).add(player.getPositionVec()); TeleportCommand; P.S: i need this to work in minecraft 1.16.5-36.0.15 @diesieben07 Can you please help me?
  2. Can you please tell me how to use the teleportcommand method or its syntax. @diesieben07
  3. Small update!! I found the way to scale and add the lookvec to positionvec, but i still dont know how to teleport the player to that location.it would be very helpful if you could tell me which teleportation method i should use Thanks in advance public static void OnSwordClick (PlayerInteractEvent.RightClickItem event){ LivingEntity player = event.getEntityLiving(); if (player.getHeldItemMainhand().getItem() == myItem){ player.getLookVec().scale(2.0F).add(player.getPositionVec()); } } can you tell me if it is correct @diesieben07
  4. I found randomly th getlookvec method but i didnt know how to use it. BTW i dont know about the teleport command that you are talking about
  5. Thank you for giving me this idea but can you help me implement the trigonometry function in my program
  6. Hello I am a beginner minecraft modder i have some issues when trying to add a right click functionality to my sword. The problem is that no matter what i have tried i cannot get my minecraft character to move in the direction he was facing. Here is the part of my code that is causing me trouble. Please help! Thank you in advance. @SubscribeEvent public static void OnSwordClick (PlayerInteractEvent.RightClickItem event){ LivingEntity player = event.getEntityLiving(); if (player.getHeldItemMainhand().getItem() ==myitem){ // teleport the player x blocks in the direction that he is facing } } P.S:my forge mdk version is 1.16.5 - 36.0.45
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.