[Tutorial] [1.7.5] WASD Entity Riding

Discussion in 'Resources' started by DSH105, Jul 26, 2013.

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

    MrStrauss

    DSH105
    There is an error :
    I tried to override the method but it doesn't work :/
    Thanks.
     
  2. Offline

    ChroniclerBat

    Thanks guys, I got it!
     
  3. DSH105 Is there any way to do this with a EntityMinecartRideable, Since that's no EntityLiving... I need something for the minecart to have WASD controlls
     
  4. Offline

    gyroninja

    Look into the code that controls the minecart which allows you to nudge it when in the cart. When you press W or S in the minecart, it is sending the same packet, and likely a very similar method.
     
  5. Offline

    OneMael

    Hello @DSH105,

    (Sorry for my english, I'm french)

    I'd like to arrange everything as his.

    So I already have my class hand after I have a class that extends into Entity (Name) and another class that extends the class that I just created?

    A person would have a very simple example to mount a chicken, for example, I see how everything is organized.

    Thank you.
    Maki!
     
  6. Offline

    OneMael

  7. Offline

    AragurLp

    Is it also 1.8 Combatible?
     
  8. Yes if you modify the classes and fields.
     
  9. Offline

    Tiliondc

    Wouldn't another way be to make the human look like the entity and the entity look like the human. And then have the entity ride the human?
     
  10. Offline

    BurnerDiamond

    Sorry to bump this thread but does anyone know what this changed to?

    W, a0, bd, be, i
     
  11. Offline

    RingOfStorms

    Not sure what those variables changed to as I use the public accessor methods which are now as follows:

    PacketPlayInSteerVehicle.d() = shift
    PacketPlayInSteerVehicle.c() = space
    PacketPlayInSteerVehicle.b() = forward/backward
    PacketPlayInSteerVehicle.a() = sideways directions
     
  12. Offline

    KingOfAdventure

    @RingOfStorms
    Sorry if this is a bit off topic, but how do you use PacketPlayInSteerVehicle? Sorry if this is a really stupid question, but I'm new to craftbukkit, so I do not understand how to use the whole packet thing yet.


    Update :
    I found a way to use that event with protocol lib

    For other people with the same troubles :

    Code:
    public class InputListener extends PacketAdapter{
    
    
      
        public InputListener(Plugin plugin, ListenerPriority listenerPriority,PacketType[] types) {
            super(plugin, listenerPriority, types);
        }
    
      
        @Override
        public void onPacketReceiving(PacketEvent event) {     
            if(event.getPacketType().equals(PacketType.Play.Client.STEER_VEHICLE)){
                PacketPlayInSteerVehicle ppisv = (PacketPlayInSteerVehicle) event.getPacket().getHandle();
              
                  
                //Usage ppisv
                boolean shift = ppisv.d();
                boolean space = ppisv.c();
                float forward = ppisv.b();
                float side = ppisv.a();
              
            }
        }
    }

    And in on enable
    Code:
    ProtocolLibrary.getProtocolManager().addPacketListener(new InputListener(this,  ListenerPriority.HIGHEST, new PacketType[]{PacketType.Play.Client.STEER_VEHICLE}));
     
    Last edited: May 10, 2015
  13. Offline

    Sevening

    Hey ! Thanks for the tutorial :D

    I have a question .

    I've made a custom Fluing Cow , I can't change the fly speed D:

    Could someone help me ? :c

    Thanks :D
     
  14. Will it work with a wither boss entity?
     
  15. The code is similar to RideThaMob plugin????

    EDIT: It will be nice if it was working on 1.8!
     
Thread Status:
Not open for further replies.

Share This Page