• We are now in Discord! Join our community discord for latest server news and more! You will also get a FREE RARE TREASURE when successfully linking your account! Join now, click here!
  • This portion of the forum has moved to Discord!

SCBB Anti spawn kill

Should this be implemented?

  • Yes

  • No (feedback wanted)


Results are only viewable after voting.

PenguinPeople

Active Member
A system that makes you spawn with 5 seconds of being unable to be hit or hit anyone else to prevent the ever so common spawn killing.
 

SAFollis

Trusted Member
Yes, this would be nice. Before I suggested adding event.getPlayer().setHealth(20); so it would still insta respawn but Zain said it would cause double deaths (which, granted, it does every so often), but you could add a delay event such as:
Code:
public class DeathExample impliments Listener {
   public static List<Player> tempDeadPlayers = new ArrayList<Player>();
   Plugin plugin;

   public DeathExample(Plugin plugin) {
      this.plugin = plugin;
   }

   @EventHandler
   public void onDeath(PlayerDeathEvent e) {
      Player p = e.getPlayer();
      if (tempDeadPlayers.contains(p)) return;
      tempDeadPlayers.add(p);
      System.out.println("wooo boiii " + p.getDisplayName() + " ded");
      //OTHER DEATH CODE
      plugin.getServer().getScheduler().callSyncDelayedTask(plugin, new Runnable() {
         @Override
         public void run() {
            tempDeadPlayers.remove(p);
         }
      }, 1L);
   }
}

note: that is just pseudo code, you'd probably need to do some more stuff (and would have to register the events and initialize the class, and a bunch of other things the plugin might use such as maybe using a death scoreboard count rather than a dummy value) and don't completely have the delayed task thing memorized. I'm just pretty sure that's it; but this should work in theory.
 

PenguinPeople

Active Member
Yes, this would be nice. Before I suggested adding event.getPlayer().setHealth(20); so it would still insta respawn but Zain said it would cause double deaths (which, granted, it does every so often), but you could add a delay event such as:
The double deaths occur when you are killed with a yoshi stomp mid air. Wouldn't spawning with a 5 second invulnerability prevent this from happening.
 

SAFollis

Trusted Member
The double deaths occur when you are killed with a yoshi stomp mid air. Wouldn't spawning with a 5 second invulnerability prevent this from happening.
I mean in the code itself, for some reason setting a player's hp to full when they're dead can cause it. That's a different issue that isn't yoshi.
 

Zainos

Owner, Founder and Lead Developer
Owner
Staff Manager
Done! It will come in action once the major scbb update is done, which is being released very very soon! :D
The double deaths occur when you are killed with a yoshi stomp mid air. Wouldn't spawning with a 5 second invulnerability prevent this from happening.
That was fixed long ago m8
 

Zainos

Owner, Founder and Lead Developer
Owner
Staff Manager
Yes, this would be nice. Before I suggested adding event.getPlayer().setHealth(20); so it would still insta respawn but Zain said it would cause double deaths (which, granted, it does every so often), but you could add a delay event such as:
Code:
public class DeathExample impliments Listener {
   public static List<Player> tempDeadPlayers = new ArrayList<Player>();
   Plugin plugin;

   public DeathExample(Plugin plugin) {
      this.plugin = plugin;
   }

   @EventHandler
   public void onDeath(PlayerDeathEvent e) {
      Player p = e.getPlayer();
      if (tempDeadPlayers.contains(p)) return;
      tempDeadPlayers.add(p);
      System.out.println("wooo boiii " + p.getDisplayName() + " ded");
      //OTHER DEATH CODE
      plugin.getServer().getScheduler().callSyncDelayedTask(plugin, new Runnable() {
         @Override
         public void run() {
            tempDeadPlayers.remove(p);
         }
      }, 1L);
   }
}

note: that is just pseudo code, you'd probably need to do some more stuff (and would have to register the events and initialize the class, and a bunch of other things the plugin might use such as maybe using a death scoreboard count rather than a dummy value) and don't completely have the delayed task thing memorized. I'm just pretty sure that's it; but this should work in theory.
Your tryharding amazes me, you have beaten Trenly Congratulations!
 
Top