Primed TNT

Discussion in 'Plugin Development' started by snake4212, Jul 4, 2013.

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

    snake4212

    How can I spawn Primed tnt all I need is the rest of the player.(NotTheRealCode)SpawnPrimerTNT.class
    or whatever it is please get back to me asap
    So the code is like
    player.LaunchProjectile.PrimedTNT.class
    Ik thats not it please tell me what it is
     
  2. Offline

    Trevor1134

    Try:
    TNTPrimed tnt = target.getWorld().spawn(target.getLocation(), TNTPrimed.class);

    Hopefully you can figure the rest out.
     
  3. Offline

    chasechocolate

    Code:java
    1. TNTPrimed tnt = world.spawn(loc, TNTPrimed.class);


    EDIT: Ninja'd by Trevor1134
     
  4. Offline

    snake4212

    This isnt working for my case or I am just failing to add it in
     
  5. Offline

    Trevor1134

    Try:
    Code:java
    1. if(cmd.getName().equalsIgnoreCase("PTNT")){
    2. if(args.length == 0){
    3. sender.sendMessage("Target a player!");
    4. }else if(args.length == 1){
    5. Player target = Bukkit.getPlayer(args[0]);
    6. World world = target.getWorld();
    7. Location loc = target.getLocation();
    8. TNTPrimed tnt = world.spawn(loc, TNTPrimed.class);
    9. }
     
  6. Offline

    snake4212

    Its not a command thats the thing

    I have all these that work I just dont know what to put for tnt
    Code:
     
    switch(a) {
    case FIREBALL:
    player.launchProjectile(LargeFireball.class);
    return null;
    case ARROW:
    return player.launchProjectile(Arrow.class).getUniqueId();
    case CREEPER:
    return player.launchProjectile(Egg.class).getUniqueId();
    case GUN:
    return player.launchProjectile(Snowball.class).getUniqueId();
    case THUNDER:
    return player.launchProjectile(WitherSkull.class).getUniqueId();
    case HEAL:
    player.setHealth(player.getMaxHealth());
    return null;
    case SHOTGUN:
    return player.launchProjectile(Snowball.class).getUniqueId();
    case AUTOMATIC:
    return player.launchProjectile(Snowball.class).getUniqueId();
    case TNT:
    return );;
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  7. Offline

    Trevor1134

    return player.launchProjectile(TNTPrimed.class).getUniqueId();

    ???

    Two things:
    Use pastebin.com
    Tell us what you want, we can't read your mind.
     
  8. Offline

    snake4212

    Sorry and still no -_-
     
  9. Offline

    chasechocolate

    Trevor1134 you can't launch a TNTPrimed as a projectile as it does not extend Projectile. snake4212 use this:
    Code:java
    1. TNTPrimed tnt = player.getWorld().spawn(player.getLocation(), TNTPrimed.class);
    2.  
    3. tnt.setVelocity(player.getLocation().getDirection());
    4. return tnt.getUniqueId();
     
  10. Offline

    snake4212

    Primed tnt isnt a projectile
     
  11. Offline

    Trevor1134

Thread Status:
Not open for further replies.

Share This Page