1. Heya all.

    I have been looking and looking for hours to find a solution or a simple plugin what can make "Entity.spawn player" to sleep. Just so i can add "fake sleepers" in random bases i build around, so if someone raid in they find a "npc" sleeper there.

    Is this even possible to do?


    Thank you for any help/advice tricks and tips.
     
  2. Code:
        public virtual void StartSleeping()
        {
            if (this.IsSleeping())
            {
                return;
            }
            this.EnsureDismounted();
            this.SetPlayerFlag(BasePlayer.PlayerFlags.Sleeping, true);
            if (!BasePlayer.sleepingPlayerList.Contains(this))
            {
                BasePlayer.sleepingPlayerList.Add(this);
            }
            base.CancelInvoke(new Action(this.InventoryUpdate));
            this.inventory.loot.Clear();
            this.inventory.crafting.CancelAll(true);
            this.UpdatePlayerCollider(true);
            this.UpdatePlayerRigidbody(false);
        }
    
    this ? (from BasePlayer component)
     
  3. Alright...But!! aha you my dear friend forget that you are writing to a total retard. I do see, that the "BasePlayer.sleepingPlayerList.Add(this);" is there, but how in earth does a dum dum caliber of me use that in game? as quick thought and try i did get the "baseplayer" value with debug_lookat but nothing happens when adding number... Again pointing out that i am not really that smart when it comes to running those kind of things.. more used to the console commands way.
     
  4. To use this code, you will need to create a simple plugin. I will be able to create something basic for you if you want
     
  5. That would be lovely if you could do so RedBDGR. Please.

    When it comes to making plugins i got no idea. I just know how to change settings from files and that stuff.

    Please do make me a simple one :)
     
  6. Here is something simple that just makes a chatcommand for you to use.
    Permission to be able to use the command is sleepercreator.use
    Command is /createsleeper "sleepername"
     

    Attached Files:

  7. Super, thank you very much :D you rock !