how would i do this

Discussion in 'Spigot Plugin Development' started by timmaker, May 4, 2015.

  1. what i want to do is this:

    but then also let the carts go up how would i do This?
     
  2. hmmm... interesting my guess would be set it up like a minigame get the passengers and set the cars movment to 0 (its a entity so freeze it movment) then if all entitys that are minecarts in the radius of like a(n) invisible mob in the middle as the base, then check if they all have passengers and then start a runnable that will set positions that mincart goes to! :p
     

  3. But it should also start if they don't have a passeneger, and if i'm not mistaking you should be able to get the nerby entities from a location as well, but i can't get it to work because i don't know how to make circles and helixes with vectors and velocity
     
  4. Spawn a minecart and then set the player as the passenger and it might be an entity that spawns invisible below it. Wait a sec while I try and do an example.
     
  5. public void Minecraft(Player player, Entity ent, Location loc){
    player.getLocation().spawnEntity (EntityType.MINECART());

    //DO STUFF
    @EventHandler
    public void saw(PlayerJoinEvent e){
    Player player = e.getPlayer();
    Minecraft();
    player.sendMessage("SPAWNED YOUR CAR");


    HAVE NOT TESTED THIS.. DON'T KNOW IF IT WORKS.. IT'S HARD TO TYPE ON MY PHONE :p
     
  6. Maybe something like this...
    Code (Text):
            Chicken chicken =(Chicken)player.getWorld().spawnEntity(player.getLocation(), EntityType.CHICKEN);
            chicken.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 180000, 1));
            Minecart mc = (Minecart)player.getWorld().spawnEntity(player.getLocation(), EntityType.MINECART);
            chicken.setPassenger(mc);
            mc.setPassenger(player);
     
  7. Does not work.. You are setting method with parameters but when you are calling that method it is without parameters.
     
  8. Try my example
     
  9. Thats not the problem im having its that i don't know how to make the minecarts make a circle or a helix
     
  10. I do have a method to making it so you can make the minecart move by your eye location.
     
  11. i know that method but i want it just like in the video go in a pattern without user input