1

I have a bukkit server running on a Raspberry Pi 512MB (personal project for the heck of it) and I thought I'd try inviting some friends (~2/3 can't go over 4 players because of RAM) just for testing.

My problem/question is, does anyone know of a way (preferably not a mod, or a very light one) that I can set up a spawn chest that only they and the Op can access? I would want the stuff in it like a regular spawn chest (Axe, Wood, Sticks, Books explaining the site, etc.) Or, alternatively, set it up so the players spawn again, first time only) in with the books already in their inventory.

I think the first is cooler, but either works.

4
  • Would this go better on Stack Overflow? Commented Jan 22, 2014 at 12:11
  • With command blocks and scoreboards, you can give items directly to new players. It's not quite what you're asking, but it should be possible.
    – MBraedley
    Commented Jan 23, 2014 at 13:45
  • @RPiAwesomeness questions like this don't get that much attention on SO
    – Jojodmo
    Commented Feb 14, 2014 at 16:05
  • Probably best on SpigotMC forums
    – mekb
    Commented Jul 9, 2020 at 11:46

2 Answers 2

4

You can use Essentials Kit/Spawn. Just add your items into the Kit part of the config and add the kit to the Spawn part of the config. More information can be found here: http://wiki.ess3.net/wiki/Command_Reference/Kits

2
  • Sorry, should have said this in my question, but I'd rather not use any more mods, as the server is a Raspberry Pi with 512MB of RAM :) How heavy is this on performance/RAM usage? Commented Jan 22, 2014 at 19:28
  • I have no idea, lol, but seeing you have the Commandbook plugin, you can just create a kit using that and set a extremely long delay for it. The downside is that the new players need to use the command to get the kit. Just try Essentials, and if your server can't handle it, try the Commandbook solution.
    – Enoch
    Commented Jan 22, 2014 at 19:48
2

You could make a simple bukkit plugin that gives them items on first spawn... You could use something like:

@EventHandler
public void playerJoin(PlayerJoinEvent e){ //called when player joins
    Player p = e.getPlayer(); //get the player who joined
    if(!p.hasPlayedBefore()){ //check if the player has not played before

        p.getInventory().addItem(Material.IRON_PICKAXE);
        p.getInventory().addItem(Material.IRON_AXE);
        p.getInventory().addItem(Material.IRON_SPADE);
        //give the player an iron pick, iron axe, and iron shovel if it is their first time playing
    }
}

This code would, in words, do:

When a player joins:
    if the player has not played before:
        give player iron pickaxe
        give player iron axe
        give player iron shovel

if you would like to use custom books, you would have to use ItemStacks, like so:

ItemStack itemStack = new ItemStack(Material.WRITTEN_BOOK); //make a new written book
BookMeta bm = (BookMeta) itStack.getItemMeta; //get the book meta data of the book
bm.setTitle("title"); //set the title to "title"

bm.addPage("page 1"); //set the pages
bm.addPage("page 2");
bm.addPage("page 3");
bm.addPage("page 4");

itemStack.setItemMeta(bm); //set the meta of the book to the above


p.getInventory().addItem(itemStack); //give the player the formatted book
3
  • Very nice answer! I have looked into writing Bukkit plugins for my server, I just haven't been able to do anything with it lately as my Pi's Ethernet/USB ports were fried! (Not my fault, outside action that had nothing to do with the Pi itself) Commented Feb 15, 2014 at 0:05
  • @RPiAwesomeness If your hosting a server you have to be connected to wifi or something... There's probably a program so that you can connect your computer to your pi and edit files on it. You could code plugins on your regular computer, and transfer them over to your Pi
    – Jojodmo
    Commented Feb 15, 2014 at 16:15
  • Doemnico: Yes, that is true, and that is what I was planning on doing. However, seeing as I can't connect to the Pi in any form (Ethernet, USB, WiFi - all dead) I really can't develop. Commented Feb 15, 2014 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.