Jump to content
Indomitus

I made an Ender Chest

Recommended Posts

If you've ever played Minecraft, you know what an Ender Chest is.  For the rest of us, it's a chest that keeps a separate inventory for each player who opens it.  That means you can't see or take what other players have stored there, and they can't see or take yours.  (The Minecraft version is also able to connect to other Ender Chests, but that feature would take more time and effort to build in Ylands.)

I also included code that can spawn in starter items when a player first opens it, making it a great addition to any Welcome Center.  Simply edit the "PlayerFirstOpen" block of script.

edit:  Oops, I forgot to link to the workshop:   https://workshop.ylands.com/asset/1236

 

EnderChest_cropped.png.1ad2622155c2d07d6484cdb4b60ac2f5.png

EnderChestCode.thumb.png.68c19da751d1e615f986b2e0a7d700ae.png

 

Edited by Indomitus
  • Like 2
  • Upvote 4

Share this post


Link to post
Share on other sites

Should probably mention that you should be careful what you store in it.  It won't save things like custom colors or names, or text written on notes, or other advanced attributes like that.  It could be modified to do that, but this version won't.

Edited by Indomitus

Share this post


Link to post
Share on other sites

I just noticed a potential error in part of the code that could cause it to remove other players' items if the current player doesn't have anything in the list, or error out while trying to do it.  I'll fix it after work today.

If you already have it downloaded, and want to patch it yourself:

In "WipePlayerFromArray" on the IF statement, add:  AND IndexNum -1

 

update:

The uploaded composition is fixed.

EnderChestCode_FIX.thumb.jpg.15564ddf89da4a21981f59e831977469.jpg

Edited by Indomitus

Share this post


Link to post
Share on other sites

@Indomitus that's cool. Never tought about making a central chest. It's like a chest that can be placed in every yland and have access to certain items.

I might steal this idea :)

Share this post


Link to post
Share on other sites

I actually I have a "portable" chest. A special coin in inventory, that when is placed at ground, it spawns the chest. You can remove or add items to it. When you close it, the chest is despawned and items are saved. Then, use the coin wherever you want. :)

Edited by jchob

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×