How to do the following in Code? What type of way would I go?

Discussion in 'Plugin Development' started by TheWolfBadger, Jul 25, 2014.

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

    TheWolfBadger


    I was wondering how to do the flags animation in the above video clip from MCWarhub's trailer by MrTwiggy . I was thinking of setting the passenger, but I think this may require some NMS, but I'm not exactly sure, and would love some direction in which way to go to start on this and get this done. Thank you as always Bukkit Community. - Jack Badger
     
  2. Offline

    Garris0n

    Or you could, you know, make an attempt to come up with your own concept instead of copying somebody else.
     
    Jamscott likes this.
  3. Offline

    TheWolfBadger

    Garris0n I don't have any idea on how to make it. No one has done this besides him from what I've seen. I'd love to recreate it. I'll be sure to share the code for other developers. I just want an idea of how the plugins does this. The server has been down for 2 years btw.
     
  4. Offline

    Garris0n

    The trailer is less than two years old :p

    Anyway, it's just items stacked on top of each other and being teleported/moved in relative position to each other.
     
  5. Offline

    TheWolfBadger

    Garris0n How do the items not fall and ignore gravity though? Do you think any of this requires nms btw?
     
  6. Offline

    Garris0n


    And it might if you want to teleport them, seeing as Bukkit won't let you teleport entities with passengers/in vehicles.
     
  7. Offline

    TheWolfBadger

    Garris0n Why not a runnable running every second tping the entities to their locations to make it look like a flag?
     
  8. Offline

    Garris0n

    Every tick*, but yes, that's pretty much exactly what I meant.
     
  9. Offline

    Double0negative

    It doesn't work however, Me and a few other devs tried to recreate this and could see no possible way in the current Minecraft (maybe why the server has been down for so long). Basically, you can do all you want on the server side, remove gravity, teleport the block, add upwards velocity etc, but the client constantly tries to predict where the blocks are going causing them to fall continuously and then teleport back to the spot it is server side. Even if you do manage to balance the velocities and make it mostly smooth, any lag on the client side (network lag) will cause the blocks to fall down to the ground making it very glitchy. I do not believe this is possible anymore.

    The smoothest way I found was to constantly spawn/despawn the blocks, but this wont really scale well and will use quite a bit of network, and still suffers from the same problems described above, as well as some other side effects, mainly the client will see 2+ blocks constantly spawning/despawning instead of just the one making it look glitchy also.
     
  10. Offline

    Garris0n

  11. Offline

    Double0negative

    Yes, ofc, thats what we used. In that post however, they only move across the ground, which works fine. Hovering in the air however, not so much.
     
  12. Offline

    Garris0n

    Nope, if you note my first gif, they also float.

    It uses this API/plugin (because it'll be public at some point and I'm not reinventing the wheel), which uses the "hologram bug/feature" to make the blocks float glitch-free. I've also seen it without said bug/feature, however, and they still don't glitch out and fall that often.
     
  13. Offline

    Double0negative

    Well that is interesting, never thought of that. However the hologram thing is suppose to be patched soon right? And sure they don't fall if you have a decent connection to the server (or localhost) but if you are laggy at all they will fall
     
  14. Offline

    Garris0n

    Well it revolves around the whole "negative horse age thing" which I doubt they'd bother to patch.
     
  15. Offline

    mine-care

    Umm I belive, what they've done is to get a set of locations and drop naturally a block of wool in each one, but they keep it somewhere and when the repeating task runs again the falling item is removed and a new is placed on falling :/ I suppose it repeats every tick or so
     
  16. Offline

    TheWolfBadger

    Double0negative I tried with .dropItem() and teleporting them every Tick, however you are right. They fall straight to the ground no matter what... :/ Which stinks. <--- Garris0n Well how mine-care? It seems it won't work at all now in this version of Minecraft with drops...

    With some testing I have proven that Double0negative is right. I guess there is no possible way to recreate it :(. Too bad, because that really sucks :(.
    http://imgur.com/Rf1K2Zq

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  17. Offline

    Garris0n

    Hm, I forgot about items grouping together. Perhaps you would need NMS.

    Also, if they're riding each other, you can't teleport them.
     
  18. Offline

    TheWolfBadger

    Garris0n It would be too much work with NMS. Too much of a hassle to recreate either way.
     
  19. Offline

    Zaaryus

    Pretty sure this would cause too much lag anyways. If you want "flags", in minecraft 1.8 there will be banners which would work as flags. Bukkit devs will most likely add an api for this! :D
     
    TigerHix likes this.
  20. Offline

    TigerHix

    Yep, 1.8 flags. The itemstacks in video are very stable, I doubt even with a decent network you can't achieve it.
     
  21. Offline

    user_90854156

    I made this pole thing just now, it *should* be possible to create flags like those in the video.



    Double0negative Garris0n
     
  22. Offline

    Garris0n

    Yeah but you have to spam tp some of them next to each other and it can appear laggy (although I think it would still work).
     
  23. Offline

    Luke_Lax

    Eh it's redundant now anyway with banners being added in 1.8 that can be placed on the players helmet slot and it'll show the banner over their head. :D
     
Thread Status:
Not open for further replies.

Share This Page