I wish I could make it, really want to see this made. (I'd install it on my server too.) Hmm, I'll try help spread the word a little more.
Actually, (don't want to hijack the thread or anything), christmas is shortened to xmas because when written in greek, christ begins with an x, hence xmas was born It doesn't go away from christ
I might be able to do it all today... It seems pretty easy, just register chests and have a configurable set of items. Then choose random ones and give them.
Maybe make all of them give the same item to avoid complaints, "why did so and so get diamond and I only got Iron..." etc
gomeow Will you be adding teh gift sending feature too or should i get another plugin that does this? And the Santa/Notch?
I was going to make this for my own server aswell, but then make it like a chest hunt at our special Christmas island. Oh well. I'll finish that for myself anyway, if anyone else is interested in having it aswell, send me a PM.
KylexDavis Jahb phillipkdick Minerman01 I've finished the chest hunt plugin, It's not very configurable, but there's something you can change. Well, anyway, let me give you a short explanation. To make a christmas chest, you place a *single* (not double) chest. You then take sponge blocks (since sponge can, on most servers, and on my server, not be obtained by non-staff players) and put these in the chest. The amount of sponge blocks indicates how many presents will be spawned in the chest when a player finds it. 1 sponge block = 1 present, 3 = 3 presents, 27 = 27 presents, et cetera. *It is important that you place the sponge blocks in the first slot of the chest (upper left slot).* Now, when a player with the permission "santa.chest" finds this chest, he can rightclick on it. When he does that, a custom inventory with a fancy title will be displayed ("From Santa, for playername"). There will be random presents in this inventory. Again, the amount of slots that will be filled with presents, is indicated by the amount of sponge blocks you put in the chest. The presents are divided into two categories: not_valuable and very_valuable. Not valuable items will appear in stacks ranging from 1 to 16 items; very valuable presents will always come in stacks of only 1 item. You can define what items will be in the categories in the config.yml. It's a very simple configuration. This is how it works: Code: not_valuable: - 357 //A cookie, not valuable, will spawn in stacks with 1 - 16 items. - 353 //Sugar, not valuable, will spawn in stacks from 1 - 16 items. very_valuable: - 276 //Diamond sword, valuable will spawn in a stack of one. - 399 //Nether star, valuable, will spawn in a stack of one. The chance of getting a slot filled with a valuable item is 3/10; the chance of getting a slot filled with a not valuable item is 7/10. This is how it works. A player can only open a chest *once*. As you might know now, this plugin isn't very customizable and user-friendly. But it's a simple plugin, made for my server, I wasn't trying to make a plugin that'd be very configurable. You are free to use it and ask me for suggestions, but I'm probably not going to spend much more time in editing it, since it does the job for my server already. I can make small modifications though (if you need those). https://www.dropbox.com/s/u9eheayf6nzmgca/SantaChest.jar
The only thing left to add is that Santa delivers at a certain time. I was a little busy last night working on this: www.minewriter.net So much to do! I've done this much, someone else can add in date checking or put in a command: Code:java package me.gomeow.santa; import java.util.ArrayList;import java.util.Random;import java.util.Set; import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.Location;import org.bukkit.Material;import org.bukkit.block.Chest;import org.bukkit.command.Command;import org.bukkit.command.CommandSender;import org.bukkit.configuration.file.FileConfiguration;import org.bukkit.entity.Player;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.block.Action;import org.bukkit.event.player.PlayerInteractEvent;import org.bukkit.inventory.Inventory;import org.bukkit.inventory.ItemStack;import org.bukkit.plugin.java.JavaPlugin; public class santa extends JavaPlugin implements Listener { ArrayList<String> setChest = new ArrayList<String>(); ArrayList<String> defaultItems = new ArrayList<String>(); ArrayList<String> rndItems = new ArrayList<String>(); ArrayList<String> rndItemsRnd = new ArrayList<String>(); ArrayList<ItemStack> defaultItemsIs = new ArrayList<ItemStack>(); ArrayList<ItemStack> rndItemsIs = new ArrayList<ItemStack>(); ArrayList<ItemStack> combinedItems = new ArrayList<ItemStack>(); FileConfiguration config; @Override public void onEnable() { config = getConfig(); getServer().getPluginManager().registerEvents(this, this); saveDefaultConfig(); defaultItems = (ArrayList<String>) config.getStringList("Default-Items"); rndItems = (ArrayList<String>) config.getStringList("Random-Items"); for(String rndItem:rndItems) { Random rnd = new Random(); if(rnd.nextBoolean()) { rndItemsRnd.add(rndItem); } } for(String str:defaultItems) { String[] split = str.split(", "); defaultItemsIs.add(new ItemStack(Material.getMaterial(split[0].toUpperCase()), Integer.parseInt(split[1]))); } for(String str:rndItemsRnd) { String[] split = str.split(", "); rndItemsIs.add(new ItemStack(Material.getMaterial(split[0].toUpperCase()), Integer.parseInt(split[1]))); } for(ItemStack is:rndItemsIs) { combinedItems.add(is); } for(ItemStack is:defaultItemsIs) { combinedItems.add(is); } Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { @Override public void run() { // Set<String> people = config.getConfigurationSection("Chests").getKeys(false); ArrayList<Location> chests = new ArrayList<Location>(); for(String person:people) { chests.add(new Location(Bukkit.getWorld(config.getString("Chests."+person+".World")), Double.parseDouble(config.getString("Chests."+person+".X")), Double.parseDouble(config.getString("Chests."+person+".Y")), Double.parseDouble(config.getString("Chests."+person+".Z")))); } for(Location loc:chests) { Chest chest = (Chest) loc.getBlock().getState(); Inventory chestInv = chest.getBlockInventory(); for(ItemStack is:combinedItems) { chestInv.addItem(is); } // } } } , 36000L, 36000L); } @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(cmd.getName().equalsIgnoreCase("santa")) { if(sender instanceof Player) { Player p = (Player) sender; if(args.length == 0) { p.sendMessage(ChatColor.GOLD+"Santa Help"); p.sendMessage(ChatColor.GOLD+"I am coming to deliver gifts on Christmas!"); p.sendMessage(ChatColor.GOLD+"For me to come, just type /santa setchest and I will deliver gifts to it!"); } else if(args.length == 1) { if(args[0].equalsIgnoreCase("setchest")) { setChest.add(p.getName()); p.sendMessage(ChatColor.GREEN+"Now hit a chest to register it."); } } } } return false; } @EventHandler public void onHit(PlayerInteractEvent event) { String name = event.getPlayer().getName(); if(event.getAction() == Action.RIGHT_CLICK_BLOCK) { if(setChest.contains(event.getPlayer().getName())) { Location loc = event.getClickedBlock().getLocation(); String World = loc.getWorld().getName(); Integer X = loc.getBlockX(); Integer Y = loc.getBlockY(); Integer Z = loc.getBlockZ(); config.set("Chests."+name+".World", World); config.set("Chests."+name+".X", X.toString()); config.set("Chests."+name+".Y", Y.toString()); config.set("Chests."+name+".Z", Z.toString()); saveConfig(); setChest.remove(name); event.getPlayer().sendMessage(ChatColor.GREEN+"You set your Santa Chest!"); event.getPlayer().sendMessage(ChatColor.GREEN+"If you already had one, this replaced it."); event.setCancelled(true); } } }} Config: Code: #CONFIG # #Items all players will get: #Syntax: # - name(name/id), amount(up to 64) # #If you wanted someone to get a diamond sword, you could do 2 things: #Note: Item Names must conform to Bukkit Enum Standards. #If you aren't sure whether or not it does, # #This would give 2 diamond swords: #Default-Items: # - 276, 1 # - diamond_sword, 1 # Default-Items: - cake, 1 Random-Items: - diamond, 5 - iron_sword, 1 EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Well its the 1st of December, I am not sure if this may get deleted/locked because of necroposting but it that time of year again would anyone be interested in continuing with this project? I would make a new thread to avoid necroposting but this one has some code already done that a willing developer may be able to pickup from. I have also slightly edited the thread. gomeow Rprrr sickredstuff
*Bump* This was very active last year, is anyone else considering picking up from where others left of?