Solved Getting tick stack and sending packets independent of them

Discussion in 'Plugin Development' started by kameronn, Oct 5, 2016.

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

    kameronn

    Hey!
    I'm trying to get the tick stack and then intercepting packets to send independent from them (damage animation) to simulate that your hits feel smoother during pvp.

    But the problem is I do not know how to read/get the tick stack? Any ideas?
     
  2. Offline

    kameronn

  3. @kameronn
    I'm sorry if I'm being stupid here, but what is this "tick stack" you're talking about?

    Also, if you just want to intercept packets, have a look at ProtocolLib.
     
  4. Offline

    kameronn

    @AlvinB
    If I'm 100% honest I dont fully understand it either, but heres a quote
    "The Minecraft server has a "stack" of operations to carry out, called the "tick stack". When new operations have to be carried out, they are added to the tick stack. The tick stack is processed 20 times every second. That means any operation can unnecessarily take an additional 50ms"

    Any information would be helpful ^^
     
  5. @kameronn
    Oh. Well, the simplest way to hook into that is to use a repeating BukkitRunnable, which runs every server tick (50 ms).

    Also, just out of curiosity, what are you trying to do here?
     
  6. Offline

    kameronn

  7. @kameronn
    Well, what exactly do you need to "hook into the tick stack" for? You should use BukkitRunnables either way, but you may not want a repeating task if it's just something that has to be executed once.
     
    bwfcwalshy likes this.
  8. Offline

    I Al Istannen

    @kameronn @AlvinB
    If I understood you two right, kameronn just wants to immediately send a damage packet when he hits another entity? In this case why don't you just listen for the Use entity which is an attack packet and immediately send a damage animation to the hitting player?
    The server will take of sending it to the other players, if it was a valid hit.

    Or am I totally wrong in what you want to do, or this otherwise not feasible?
     
  9. Offline

    kameronn

  10. Offline

    I Al Istannen

    @kameronn
    Don't know if I helped, but nice you solved it :)

    Good luck with the rest :p
     
Thread Status:
Not open for further replies.

Share This Page