Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-------------------------------------------#
- # millenniumRandomChests 1.0 #
- #-------------------------------------------#
- #-------------------------------------------#
- # (c) Efnilite, MillenniumUS 2018-2019 #
- # You aren't allowed to: #
- # Copy this code #
- # Sell this code #
- # Or claim this code as your own. #
- #-------------------------------------------#
- # These are the main functions. It is not recommended to edit the file further than these options, unless you know what you're doing.
- options:
- # Set the prefix of commands here.
- prefix: &bmChests >
- # Set the permission required to execute this command.
- perm: is.admin
- # Set the message if the player has not gotten that permission.
- noperm: &cYou don't have the permission to do that!
- # The least amount of items that a chest can get.
- minitems: 3
- # The maximal amount of items that a chest can get.
- maxitems: 3
- # Don't edit the information below.
- author: Efnilite
- copyright: MillenniumUS
- version: 1.0
- # Set all of your custom items here.
- on load:
- clear {ritem::*}
- # You can add as many things as you like. You just need to repeat what I am doing here multiple times.
- # This adds 1 diamond boots to the random item list. In the text you will atleast need the parts of the list and the add.
- # COPY AND PASTE THIS: add (amount of items you want) (type of item) to {cheloc::*}
- # NOTE :: If there is only one item in the stack then you can just type: add (type of item) to {cheloc::*}
- # If you don't want to edit this, then I have already made a half decent setup, for mostly SkyWars and SurvivalGames use.
- # If you don't want all this extra stuff, then just remove all of it.
- add 1 cooked porkchop to {ritem::*}
- add 1 cooked porkchop to {ritem::*}
- add 1 cooked porkchop to {ritem::*}
- # Actual command. Not recommended to edit.
- command /mchest [<text>]:
- trigger:
- if arg 1 is "add":
- if player has permission "{@perm}":
- if target block is chest:
- add location of target block to {cheloc::*}
- message "{@prefix} Succesfully executed &3AddChest"
- loop {cheloc::*}:
- if loop-value is location of target block:
- message "{@prefix} This chest has already been checked as a mCHEST!"
- stop
- else:
- message "&b{@prefix} You need to select a chest!"
- else:
- message "{@noperm}"
- if arg 1 is "remove":
- if player has permission "{@perm}":
- if target block is a chest:
- remove location of target block from {cheloc::*}
- message "{@prefix} Succesfully removed the selected chest!"
- clear inventory of target block
- stop
- else:
- message "{@prefix} You need to select a chest!"
- else:
- message "{@noperm}"
- if arg 1 is "refill":
- if player has permission "{@perm}":
- loop {cheloc::*}:
- set {_cheslot::*} to ""
- loop 27 times:
- add loop-number to {_slotnum::*}
- clear inventory of block at loop-value
- wait 1 tick
- message "&b{@prefix} Succesfully executed &3ChestRefill"
- set {_loop} to a random integer between {@minitems} and {@maxitems}
- loop {_loop} times:
- set {_cheitem} to a random element out of {ritem::*}
- set {_cheslot} to a random element out of {_slotnum::*}
- add {_cheitem} to slot ({_cheslot} - 1) of block at loop-value-1
- else:
- message "{@noperm}"
- if arg 1 is "about" OR "version":
- message "&3&lmChests &r&b> Currently running version &3{@version}&b, copyright &3{@copyright} &band was created by &3{@author}"
- if arg 1 is not set:
- if player has permission "{@perm}":
- message "{@prefix} You need to specify a command! Usage: /mchest <add/remove/refill>"
- else:
- message "{@noperm}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement