Stop EnderDragon's Infernal Flapping

Discussion in 'Plugin Development' started by MeRPG, Sep 10, 2014.

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

    MeRPG

    So, I've been using Remote Entities and ProtocolLib to try and make an enderdragon that sits at specified coordinates and stays stationary. It works! But... It flapps ALL the time. And it is realllly annoying to players. So, I was trying to use protocollib to stop the sound packets. This is my code for that:
    Code:java
    1. manager.addPacketListener(new PacketAdapter(new PacketAdapter.AdapterParameteters().serverSide().types(PacketType.Play.Server.NAMED_SOUND_EFFECT).plugin(this)) {
    2. @Override
    3. public void onPacketSending(PacketEvent event) {
    4. Main.inst.getLogger().info("Sound Packet");
    5. if(event.getPacketType()!=PacketType.Play.Server.NAMED_SOUND_EFFECT) return;
    6. Main.inst.getLogger().info("Sound Packet2");
    7. PacketContainer packet = event.getPacket();
    8. Main.inst.getLogger().info("Sound Packet: "+packet.getStrings().read(0));
    9. if(packet.getStrings().read(0).equalsIgnoreCase("mob.enderdragon.hit") || packet.getStrings().read(0).equalsIgnoreCase("mob.enderdragon.wings") ||
    10. packet.getStrings().read(0).equalsIgnoreCase("mob.enderdragon.end") || packet.getStrings().read(0).equalsIgnoreCase("mob.enderdragon.growl")) {
    11. event.setCancelled(true);
    12. }
    13. }
    14. });

    It seems to work for all of the sounds EXCEPT the flapping. I was wondering if I was doing something wrong...
    Maybe Comphenix?
     
  2. Offline

    Comphenix

    Try adding a packet listener for all sent packets (except MAP_CHUNK and MAP_CHUNK_BULK), preferably in a world with not many entities (such as The End):
    Code:
    /packet add play server 1-32 34-37 39-100 true
    You might be able to find a packet for the idle sound, but it's very possible it's only client side.

    I do know the "end" sound is triggered by the effect packet (WORLD_EVENT in 1.6.4), but it doesn't look like there's an idle sound.
     
  3. Offline

    MeRPG

    Ok I'll try that as soon as I can.

    So I tested, and no luck. I listened to everything from WORLD_EVENT and got nothing. But, this page https://github.com/SirCmpwn/Craft.Net/blob/master/source/Craft.Net.Common/SoundEffect.cs that I got to from http://wiki.vg/Protocol#Effect indicated the existence if mob.enderdragon.wings... I'm not sure what I should conclude from that.

    Edit: I only tested the latter solution... My bad. I'll listen to all packets tomorrow.

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

    MeRPG

    Hrm. Couldn't find it. Must be client side.
     
Thread Status:
Not open for further replies.

Share This Page