on RespawnEvent

  • English

We've posted an important announcement regarding the current situation and the future of the game: Announcement

  • Basically what I am trying to do is reset or change the Respawn vs the Spawn first time inventory. I guess I have to find a different way and remove it one by one since this does not work. Or do I have to clear and and then set it as an attribute.. not sure. I will try something different.

    @EventMethod
    public void onPlayerRespawn(PlayerRespawnEvent event){
    // Inventory inventory = player.getInventory();
    event.getPlayer().getInventory().clear();
    }
  • Basically your approach is correct. However, unfortunately the "PlayerRespawnEvent" is called before the inventory of the player is changed (i.e. set back to the spawn inventory), so any changes you've done to the inventory will be overridden...
    We will add a new "setKeepInventory()" setting to the respawn event with the next update, so if you call it and set it to true, the player will keep his inventory (so you can change the inventory within the event) ;)
  • Thanks Red ..I was thinking something that was going on and was going to put a timer to delay the command but I thought I would see if there was something else. It will be nice to change the initial spawning with the respawn for a couple of reasons. One is you put a few things in an initial spawn for a new player and some guy found a work around some of my restriction with committing suicide all day long to get the specialized items. The other is no need for 400 stone axes in all the chests in the game.

    :D ^^