Set a mob on fire with a command?

Discussion in 'Plugin Development' started by ArcheCane, Oct 16, 2011.

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

    ArcheCane

    Simply as the title says, how do I do this?
    I don't know what the event is for setting a mob on fire.
    Examples please? :3
     
  2. entity.setFireTicks(int)
    int is the amount of time you want the entity to burn (mobs are entities btw).
     
  3. Offline

    ArcheCane

    Okay thanks, but how do I make a command that when you point at a Mob it sets it on fire?
    Examples? :3
     
  4. Making a command -> read tutorials, there are enough out there.
    Getting the mob the player points at: A bit more difficult to reliably accomplish. You could try an approach with player.getLineOfSight(...) in combination with player.getNearbyEntities(...).
     
  5. Offline

    ArcheCane

    I know how to make a command, and I have no idea on how to use those entities...
     
  6. Offline

    joehot2000



    publicboolean
    onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    if (commandLabel.equalsIgnoreCase("fall"
    )){
    Player player = (Player) Sender;
    Location ploc = player.getLocation;
    player.getNearbyEntities(x, y, z);


    i think you should be able to go from there.
     
  7. Offline

    Woobie

    Code:
    for(Entity entities : player.getNearbyEntities(int, int, int)) {
        if(!(entities instanceof Player)) {
            entities.setFireTicks(int); 
    Just sayin'
     
  8. Offline

    joehot2000

    oh of course, i would set players on fire.
    silly me :p
     
Thread Status:
Not open for further replies.

Share This Page