Solved Some entity/projectile problems?

Discussion in 'Plugin Development' started by InflamedSebi, Apr 13, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    hay, I did some testings on this topic but some problems occoured....:

    About projectiles:

    there is a .spawnArrow(loc, velocity, speed, spread);
    is velocity just used for direction? because there is a seperated speed ...
    ... but shouldn't it be .spawnArrow(loc, direction, speed, spread) then?

    Fireballs or other projectiles, doesn't have a speed... how to adjust something, which does not exist? xD
    or is it the length of the velocity?

    what is speed like? speed = 1 == 1 block per sec? 1 block per tick?

    at what value is the virtual gravity? 0.981?

    About entities:

    I was trying to create a flying entity out of the EnderSignal.class ... i can spawn it manually but then it travels at insane speed to a fixed Location ... is there a way to create a different type (like MyEnderSignal) out of the given and maybe just change:
    the way it moves
    the amout of ticks until despawn?
    why i want this: (open)

    I try to create them as a flying warden, and they will shoot at u, if u are near them ... but u can catch them and use them as turrets or something ...
  2. Offline


    velocity gives the direction. I'm not sure if it is normalized when interpreted, but the way I see it, the speed is a multiplicative factor for the velocity.

    You can set the speed/velocity of any entity, it is in the entity interface.

    speed is measured in blocks/s

    I guess that gravity is 9.8 blocks/s2. The blocks are 1 m wide, so it is all in meters/s, m/s2, etc...

    When extending an EnderSignal, you have to override the l_() method, which governs the way the entity moves. Have a look here :
  3. Offline


    ty :D Nitnelave

    the l_() {} is too complicated to recreate ... because most of the variables are named like: a b c bd bc ... and i have no idea what they do or contain xD

    NMS is crap xD
  4. Offline


    I looked to the code:
    this.e = ticks the entity lived
    this.U = the last X location
    this.V = the last Y location
    this.W = the last Z location = if the world may update ticks
    this.motX = velocity X
    this.motY = velocity Y
    this.motX = velocity Z
    this.c = I think that this is the heigth, if the ender eye is higher than this, it wil move down (guessing)
    this.G() = seems to control when it needs t change paticle (guessing)
    float f = speed the velocity will be multiplied
    super.l_(); = call parent move code
    this.f = if this ender eye drops a item or dies when it end its track
    this.setPosition(double,double,double) = updates the location of the entity

    Hope this helped you understanding the code
    Disclaimer: I just looked at the code and this is not tested if those things really represents what I think what they do
Thread Status:
Not open for further replies.

Share This Page