Mobs die when they teleport between worlds

Discussion in 'Support' started by AnimalMace, Jul 6, 2018.

  1. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    Hi,

    I wonder why every mob that teleports between worlds auto. dies,
    and how i'm able to prevent that..

    there is not much to say about it,
    as i use these mechanics:

    Code:
    Teleport:
      Skills:
      - teleportto{location=0,65,1;world=Mansion} @PIR{r=8}
      - teleportto{location=0,65,0;world=Mansion} @self
    this is a really big part of the gamemode,
    i'm still seeking a solution

    Thanks
    AnimalMace
     
    #1
  2. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    bump ..
     
    #2
  3. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
  4. Omanoctoa

    Omanoctoa Member

    Joined:
    Mar 10, 2016
    Messages:
    113
    Likes Received:
    11
    Hmmmm Teleporting between worlds is...difficult. I would suggest alternatively to kill one mob and spawn in anew in the other world at the location you want it at, but depending on your situation that may not be practical.

    If you insist on teleporting the mob, you may need to prevent them from despawning or make them persist (Despawn: false / Persistent: true)
     
    #4
  5. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    Thanks for your reply,

    killing the mob and spawning another one in the required world wouldn't work,
    as every mob has around 32 000 000 unique combinations of stats.

    i will set Persistent on true, as I already have Despawn at false

    I also noticed that the mob is only getting killed when a player comes nearby,
    I dont know if this has to do with activating the chunk or something else..

    EDIT: the mob still dies,
    is it maybe possible to find what damage is causing to kill the mob
    and making it Invulnerable to it using damage modifiers?
     
    #5
    Last edited: Jul 9, 2018
  6. Omanoctoa

    Omanoctoa Member

    Joined:
    Mar 10, 2016
    Messages:
    113
    Likes Received:
    11
    I think it's vanilla behavior - not so much that the mob is dying but being despawned?

    To test the invulnerability, you could always give it a brief skill to Change its Invincible mob Option using...
    Code:
    - command{c="execute <target.uuid> ~ ~ ~ entitydata <target.uuid> <&lc>Invulnerable:1b<&rc>"}
    Here's some context behind the command: https://www.mythicmobs.net/index.php?threads/mobs-invincible-to-players-but-not-other-mobs.646/

    Basically, make a skill that makes the mob invincible briefly, say for 5-10 seconds, then run a second skill making it mortal again.
     
    #6
  7. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    It is helping, the mob doesn't die anymore,
    but just gets removed (looks like the remove mechanic, without death animation)
    so it is coming close, i think?

    and i think that it is vanilla behavior..
    normally, a wolf would follow his owner when teleporting to the nether/end,
    but it sits down & does nothing for some reason..

    I'm using Multi verse as world manager,
    world Multi verse's portals maybe get this done? (i forgot how they worked/have to be made, so i'm testing ideas anyway..)
     
    #7
  8. jaylawl

    jaylawl Community Manager
    Super Moderator Supporter Premium Supporter Quality Assurance

    Joined:
    Sep 16, 2015
    Messages:
    1,758
    Likes Received:
    170
    Hi. Mobs can't teleport into unloaded chunks. You need to find a way to load the chunk at the destination of the teleport before sending the mob there. This is the only solution that i know of.

    Try tp'ing your mob to spawn for example which under normal circumstances is always loaded. Tp to there should work.
     
    #8
  9. Omanoctoa

    Omanoctoa Member

    Joined:
    Mar 10, 2016
    Messages:
    113
    Likes Received:
    11
    Hmm...ideally a solution to the unloaded chunks would be to use... alright I know I've seen something to load chunks. I know PreciousStones can do it. In theory you could create a simple field that could be placed for the sole purpose of loading a chunk. Remotely place it with a MythicMob skill, then remove it once the mob teleports.

    But depending on your usage of these (pets? boss? horses?) and how common they are, this could cause serious lag. Or it could have no effect at all since it's only loading one chunk at a time.

    Purely with MM however, I'm not sure if this is possible. I swear I've seen something to do with chunk loading somewhere but I don't recall anything.
     
    #9
  10. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    thanks for your reply, ;)
    i tryed to keep the chunks active with some of my accounts. (1 account at the start of the teleport, and 1 at the destination.)
    this didn't work, the mob still disapeared..

    i never heard of PreciousStones, i could probably try it, and i think that i'm prob. going to make the teleporters in 1 area to prevent lagg as the mobs are very common, (more common then sheeps, cows, pigs & chickens)
     
    #10
  11. Omanoctoa

    Omanoctoa Member

    Joined:
    Mar 10, 2016
    Messages:
    113
    Likes Received:
    11
    In that case, definitely don't go the PS route. If they are common mobs it would cause too much lag. Precious Stones is fun to use though - basically it allows you to bind area effects to a block (custom name/lore if wanted) that players can place for certain effects (if set up that way) and broken just as easily. The true value is being able to pick a Field back up and place it somewhere else. Truly great!
     
    #11
    AnimalMace likes this.
  12. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    I still dont have the teleporting working…
    As it is an option, i expect that it is tested and possible to work; does someone maybe have an example config with the TeleportTo mechanic with another world included working?

    i have to do something wrong atm, but i can't find what..
    i'm just testing with the mechanic ~onInteract and ~onTimer:20 trigger, (it works on players)
    this is the line that i'm using:
    Code:
      - teleportto{location=0,65,1;world=Mansion} @PIR{r=8}
      - teleportto{location=0,65,0;world=Mansion} @self
    i hope that someone has the answer.
    thanks for the previous help,
    AnimalMace
     
    #12
  13. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
  14. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
  15. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
  16. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    I'm so happy, i finally got it working.
    I've put the skills on a pig (dummy mob) and noticed that mythicmobs will see the teleported pig as a new spawned pig.

    The entity that i whas trying to teleport whas being removed because i had ~remove on the same type of entity but in the vanilla mobs config.
    I changed the line and all my mobs are now able to teleport between worlds right now!

    EDIT: i think that i have a new problem..
    the teleporting is working, but all the entity's skills break, but mechanics directly written in the mob's file are still running, for some reason..

    EDIT: more problems: scoreboard stats & mob owner gets also resetted. When i use the "name" variable, its showing unknown instead of the mobs name..

    how could i get the mobs teleporting between worlds without problems?
     
    #16
    Last edited: Jul 16, 2018 at 12:28 PM
  17. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    bump?

    the teleporting between worlds works now, the mob doesn't die anymore.
    but all scoreboard scores get removed, (also the mythicmob level) and all the skills break. (only mechanics that i've put directly on the mob work)
    @xikage are you familiar with this problem? If so, how could i get this working?
     
    #17
  18. Omanoctoa

    Omanoctoa Member

    Joined:
    Mar 10, 2016
    Messages:
    113
    Likes Received:
    11
    What exactly is this world-teleportation mechanic being used for? Is there some way you could work around it?
     
    #18
    AnimalMace likes this.
  19. AnimalMace

    AnimalMace Member

    Joined:
    Jul 3, 2017
    Messages:
    164
    Likes Received:
    5
    Im creating a companion system at the moment, i think that i already spend 1 year working at the project. i got everything working, and i would get really close to finishing the project if the teleportation would work. besides that, the mobs are made to only have 1 active at a time, as they manage much more then only their behaviour etc. They also keep track & manage nearly everthing that the player does & needs. I have a custom plugin(s) wich keeps count on the amount of mobs that a players owns, so i whas trying to create an extra world with plots for the players that would allow the user to save a few mobs. (the plugin doesnt remove saved entities, alot skills of the mob will get deactivated to prevent lagg. only necessary things will be active)

    if i just got the teleportation working, i'd have nearly everything working perfectly without having to remake so much things. Changing something huge (like allowing more entities to be active at a time) would cost so much time to remake everything, as i have to change nearly everything. (20k+ lines of code, more then MythicMobs only).
     
    #19
  20. Omanoctoa

    Omanoctoa Member

    Joined:
    Mar 10, 2016
    Messages:
    113
    Likes Received:
    11
    Sounds like a recreation of a Pets plugin using MythicMobs, which is impressive. Props to you!

    I still think despawning and respawning the mob would be easier, but any options that have been changed would need to be re-applied which would mean loading variables from the scoreboard when you respawn the mob. This would be possible, albeit tedious and likely mean editing the raw entitydata onSpawn.

    An alternative to this would be to teleport the mob twice...
    Once, to a spot near the world-spawn that I assume is always loaded in memory. Hide them somewhere nearby, then once the player teleports into that world, teleport them again to the player's location, instead of doing a direct teleport. This would mean the mob is always teleporting to a loaded chunk so it would not despawn, but would require a second teleport.
     
    #20

Share This Page