Jump to content

wundrweapon

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by wundrweapon

  1. EntityConstructedEvent is a forge hook. Event Handlers Cool Alias's tutorial http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-forge-1-6-4-1-8-eventhandler-and That will not work that would set all motion to 0 and change the the rotation to 0. Look into ItemBow there are two events called there.

     

    Ah, OK. Thanks for the assist, I'm fairly certain this will help

     

    Do you think this would work to disable gravity with that method?

    motionX = 0;
    motionY = 0;
    motionZ = 0;
    rotationPitch = 0;
    rotationYaw = 0;
    prevRotationPitch = 0;
    prevRotationYaw = 0;
    setRotation(rotationPitch, rotationYaw);

     

    No, that would prevent all motion.  You need to copy the existing onUpdate method and remove the alterations it makes to motionY to account for gravity.

     

    Oh, I can't believe I didn't see that :P

    I'll do what you said though

  2. 1) Extend EntityArrow and override is onUpdate method

    2) Should be an event for it, check the Bow class, if not you could wait for an EntityConstructed event, if it's an arrow, and the owner/firer is the player and the equipped bow has the enchantment, replace the entity being constructed.

    3) Probably? You'd have to migrate all of the onUpdate code to a separate function, then in onUpdate call that function until the arrow collides with something

    4) See #1, #2

     

    Do you think this would work to disable gravity with that method?

    motionX = 0;
    motionY = 0;
    motionZ = 0;
    rotationPitch = 0;
    rotationYaw = 0;
    prevRotationPitch = 0;
    prevRotationYaw = 0;
    setRotation(rotationPitch, rotationYaw);

    2) What and where is the event for EntityConstructed? Google didn't really bring up anything, and ItemBow didn't seem to have anything useful (just ArrowLooseEvent, but I don't see how I'd use it's constructor in this sense)

    3) I don't really understand - wouldn't that just take the same amount of time, since onUpdate is ultimately called at an equal rate?

    4) Oh. Duhr, can't believe I didn't see that

  3. Hello!

    In the current state of my mod, the bow has two new enchantments. Unfortunately, I have no idea how to make them work. So here's my questions:

     

    1) How would I go about making an arrow that is programmatically equal to EntityArrow, but with no effect of gravity?

    2) How can I make the bow fire this anti-gravity arrow only if the bow has a specific enchantment?

    3) Is it possible to make an arrow not go through it's trajectory, but instead end up exactly where it would end up going? What I mean is, when i fire the arrow, I want it to instantly land where it would have landed had I fired normally, but still deal the amount of damage it normally would have on that specific shot.

    3.1) If so, how?

    3.2) If not, what's the best way to feign this effect?

    4) How would I make this special shot only occur when a specific enchantment is on the bow?

     

    Thanks for the assistance!

  4. Hello

    In some code I'm working on, one item should teleport you on top of the block you're looking at. If there's no block there, nothing should happen. As it stands, someone else wrote this code and was able to get it almost perfect. The game crashes if you aren't looking at a block, the place you're teleported to isn't completely accurate, etc.

    I've come up with a series of step that'll enable me to pull this off, but I don't know how to code these (keep in mind that I'm using the latest Forge version for 1.7.10:

    [*]Extend the player's "reach" to be a massive or unbounded number

    [*]Get the coordinates of the block they're looking at

    [*]Return the player's "reach" to normal

    [*]Add 0.5 to the X and Z values previously acquired, and 1.1 to the Y value (effectively making the new coordinates in the center and on top of the block selected)

    [*]use setPosition() to send the player to the previously calculated coordinates

     

    Is this at all possible in 1.7.10? If so, how would I pull it off? Also, is there a better and/or more efficient way to do this?

     

    The code in its current form can be found here

  5. I recently made a modpack and wanted to share the fun with friends. I put all of its mods into the /server_folder/mods folder, and it crashed. So I noticed it made a 1.7.10 folder in there with only some of the mods, so I deleted the others. Yhis stopped the crash, but Forge refuses a login. The server-latest.log file is at http://pastebin.com/MWapUyPT. The only mods in /server_folder/mods/1.7.10 is:

    -bspkrsCore 6.16

    -CodeChickenLib 1.1.3.138

    -Forge Multipart 1.2.0.345

    -Forge Relocation 0.0.1.4

    -Forge Relocation FMP 0.0.1.2

    -MrTJPCore 1.1.0.31

     

    (The versions above and in the pack match)

     

    Something tells me I'm missing a file, but what? Anybody have a clue?

×
×
  • Create New...

Important Information

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