ASync Tasks

Discussion in 'Plugin Development' started by davidclue, Apr 6, 2021 at 4:01 PM.

  1. Offline

    davidclue

    Hi, I just have a question so I know that async tasks can't be used to change blocks, but could I use one to teleport entities? What exactly are the limits to async tasks like what can I and can't I do. I've heard of people just using them for calculations but could I use it to teleport entities around or is that overstepping.
     
  2. Offline

    Newdel

    No one said you couldn't do it. You just shouldn't do it. You can put basically everything in an async method. You just have to keep in mind what problems multithreading or async tasks on one thread create
     
  3. Offline

    timtower Administrator Administrator Moderator

  4. Offline

    davidclue

    Because I run a repeating task that does lots of heavy calculations and teleports entities, it causes a lot of lag.
     
  5. Offline

    timtower Administrator Administrator Moderator

    Then do the calculations async but the teleports sync?
     
  6. Offline

    davidclue

    It's sorta individual calculations for each entity so can I really pull stuff from the async task to the main thread task?
     
  7. Offline

    timtower Administrator Administrator Moderator

Share This Page