Plugin Examples


Other Plugins

In this section I will be showing you some examples of how to use OtherDrops command parameter to make the use of some other plugins easier and more fun then just using the command normally. Doing things this way can create new items that you can use to reward players or use as rare drops to add a bit of uniqueness to the server.

Essentials

One of the most common plugins out there - Essentials. Essentials has tons of commands and functions that can play well with OtherDrops; So, lets go over a few.

In this first example we are going to create a book that when used on a mob spawner will change its type to a different mob.

    MOB_SPAWNER:
        - action: LEFT_CLICK
          tool: WRITTEN_BOOK@25
          message: "You change the spawner type to Cow"
          commands: /!*spawner cow
          consumetool: 1

Ok, so, this book when left clicked on a mob spawner will change the spawners mob type to a cow. I've chosen to use a written book with a data value of 25(387:25) for this for aesthetic reasons, you can use any item really. The consumetool parameter ensures that players can't re-use the books, and, notice the (/!*) on the command line, this tells OtherDrops to run the command through the player as if they were an op, it also sends output messages to console if possible.


This next example uses the same command to make it so players can place mob spawners that they may have mined with another plugin or this plugin.

    ANY_BLOCK:
        - action: RIGHT_CLICK
          tool: MOB_SPAWNER@51
          commands: /!*spawner skeleton
          delay: 1
          permissions: place

So, in this example players that have the proper permission(otherdrops.custom.place) will be able to right click the ground with a mob spawner with a data value of 51(skeleton spawner) to place it and KEEP the mob type(normally placing a spawner will make it revert back to a pig). It does this by issuing the essentials /spawner command one tick after the player has placed to spawner. The one tick delay is there in case the server has a tiny bit of lag, it ensures that the command will run after the block has been placed(sometimes in lagging situations the command can run before the block is actually on the ground).

This can be combined with the following to allow you to pick the spawner back up:

  MOBSPAWNER:
    - drop: MOBSPAWNER@THIS


MagicSpells

The example below in a way is actually a native function of the MagicSpells plugin; however, I've never liked how the spellbooks in MagicSpells worked so I made my own that can even be used to upgrade spells.

  • Note: these examples use bPermissions, I have no experience with PEX or GroupManager so if someone else wants to create examples for them and put them in the comments I will add them.
    ENCHANTMENT_TABLE:
        - action: LEFT_CLICK
          tool: ENCHANTED_BOOK@1
          command: [/!$c teach %p reforge, /!*world larkspur, /!*user %p, /!*user addperm otherdrops.custom.refurbish, /!*user addperm ^otherdrops.custom.reforge]
          consumetool: 1
          message: "&6You have 2 upgrades left for this spell."
          flags: UNIQUE
          region: magicshop
          permissions: reforge

Alright, what have we got going on this time? In a way this works somewhat similar to the spawner-changing books shown a few examples up. You take the book and hit the enchantment table with it. Simple, right? Well there is actually quite a bit going on in the background so lets take a look. For starters only players with a special permission can trigger this drop (otherdrops.custom.reforge) in addition they must be standing in a WorldGuard region named magicshop in order to trigger the drop. The confusing mess in the command line starts out by actually teaching the player the spell, it then moves in to bPermissions commands that are selecting a world and the player that just used the book; it then adds a permission to them so they can use the book again if they get one to upgrade the spell while at the same time removing the permission required to learn this one so they don't learn it again on accident.

Upgrading the spell

In the previous example we created a spellbook that can teach players spells from the MagicSpells plugin. In this example we will build upon that and make it so that the SAME book can upgrade the spell to a stronger version.

        - action: LEFT_CLICK
          tool: ENCHANTED_BOOK@1
          command: [/!$c teach %p refurbish, /!*world larkspur, /!*user %p, /!*user addperm otherdrops.custom.repair, /!*user rmperm otherdrops.custom.refurbish]
          consumetool: 1
          message: "&6You have 1 upgrade left for this spell."
          flags: UNIQUE
          region: magicshop
          permissions: refurbish

Same stuff as the last example pretty much, notice that the book has the same data value as the last example though. This is accomplished by having OtherDrops give and take permissions each time the book is used. Without the original "reforge" permission on the last example OtherDrops won't let that drop happen so it moves on to the next one since we were given permission for it in the previous example.


mcMMO

How can OtherDrops be used for mcMMO since they don't leave much room for adding on? Easy, it can be used as a way to gain experience in a fun way. This example will show you how to create Experience Tomes; which give a set "random" amount of experience in a skill.

    ANY_BLOCK
        - action: LEFT_CLICK
          tool: WRITTEN_BOOK@511
          chance: 100
          commands: /!$addxp %p axes 1000
          flags: UNIQUE
          consumetool: 1
        - action: LEFT_CLICK
          tool: WRITTEN_BOOK@511
          chance: 10
          commands: /!$addxp %p axes 5000
          flags: UNIQUE
          consumetool: 1
        - action: LEFT_CLICK
          tool: WRITTEN_BOOK@511
          chance: 5
          commands: /!$addxp %p axes 10000
          flags: UNIQUE
          consumetool: 1

This example makes ID 387:511(Written_book@511) give a set "random" amount of experience in the axes skill to whoever uses it. As you can see it will by default always give 1000 experience; unless, the player is lucky then they may get 5000 or 10000 experience in the skill. The unique flag tells OtherDrops not to parse the other drops if this one occurs(so there is no chance of players getting the 5k and 10k or 1k and 5k drops at the same time).


EpicBossRecoded

EpicBossRecoded is a wonderful plugin that allows server owners to create custom bosses that have higher hp, are stronger, faster and can have special abilities compared to normal mobs. The downside, they don't randomly spawn in the world, they have to be manually spawned or spawned in a set location. OtherDrops can somewhat change that so when you kill a mob it has a chance of spawning a boss in its place.

    BLAZE:
        - tool: [ANY_SWORD, ANY_AXE, BOW, ANY_PROJECTILE, AIR]
          drop: DEFAULT
          command: "/!*eb boss spawn Morgaroth"
          world: Larkspur_nether
          message.server: "%p has awakened the Demon Overlord Morgaroth!"
          chance: 0.1
          flag: UNIQUE

In this example we have made it so that killing a blaze has a tiny chance of spawning the boss Morgaroth and displaying a server-wide message saying who spawned him. In this example the chance has been kept low because blazes come from spawners, the low chance is to undermine players who would create a grinder to spawn a boss; since blazes are extremely rare without a spawner putting a limitation stopping the boss from coming from spawner-based blazes wouldn't be a good idea. The world flag is present because this boss is particularly destructive and it would have been unwise to allow it to spawn in the overworld. Identically the UNIQUE flag is present because this is not the only boss a blaze can spawn on my server and even with the low chance someone would eventually get both to spawn at once and that wouldn't end well for them. The tool parameter is so varied because of other plugins run on the server and I have to account for people using unarmed/axe skill(mcmmo), and, magic bow shots/projectile spells(MagicSpells). This next example really isn't required anymore because these were officially added to the plugin in the Recoded versions, I'm adding it for people who choose not to use those versions(this can also be used for other plugins that have special mobs that can be spawned). Anyways, the next example is a custom spawn egg that spawns a boss when used.

    ANY_BLOCK:
        - action: RIGHT_CLICK
          tool: MONSTER_EGG@43
          world: [Larkspur, Larkspur_the_end, Dragon]
          chance: 100
          message.server: "&2%p &ahas summoned &3DeathWing!"
          commands: /!*eb boss spawn DeathWing
          consumetool: 1
          flags: UNIQUE

This is handled much like the random boss spawning except the player triggers it by using a spawn egg instead. Its best to use a spawn egg that has nothing on it by default(a blank white/grey egg) to avoid problems with other plugins. I've chosen to use Data-value 43, when right clicked this egg will spawn the boss called DeathWing somewhere within 3 blocks of the player. The world parameter is present because I personally don't allow bosses in all worlds(would cause problems) feel free to remove it though; the unique flag is present because this spawn egg(383:43) is also used for a few other things on my server, again, feel free to remove it if you have no need for it.


WorldGuard

I never delved to deeply into WorldGuard and OtherDrops because of limitations in WorldGuard that bugged me, I did come up with an overly complicated way to sell plots/shops using OtherDrops and WorldGuard though. Its complicated not because of the OtherDrops setup but because the plots need to be pre-defined by WorldGuard; and, you need a way to distribute the shop deeds(either as drops maybe or some sort of store).

  • Note: This is also using bPermissions, again, If someone using another permission system wants to create examples for it I'll add it.
  • Note2: This is also using Essentials commands, if you don't want players to be able to warp to their shops or don't have essentials just remove the last 3 commands.
  • Note3: In order for this to work you must set the teleport flag on the shop plot or the player won't get teleported to it.
    ENCHANTMENT_TABLE:
        - tool: BOOK_AND_QUILL@101
          commands: [/!*region addmember s2 %p, /!*region tp s2, /!*world larkspur, /!*user %p, /!*user addperm ^otherdrops.custom.shop, /!*user addperm essentials.warps.%pshop, /!*setwarp %pshop, /!$msg %p Use /warp %pshop to return here.]
          consumetool: 1
          message: "Welcome to your new shop! Do not change the floor or walls."
          permission: shop

Ok, so a quick run through of the commands being issued - First, the player is both being added to their new region and teleported to it. Secondly, they are having their shop permission removed so they can't buy more then one shop. Third, a warp is set at the shop and players are given permission to warp back to their shop using that warp. The permission used to trigger this drop is otherdrops.custom.shop.


StackableItems

Another plugin that plays nicely with OtherDrops is StackableItems which allows server owners(or in the case of these examples - player) to increase/decrease the max stack size of items, including items that can't normally stack. The following example creates a book that allows the user to increase their personal stack size of wool and dye by 10 when its used.

    ENCHANTMENT_TABLE:
        - tool: WRITTEN_BOOK@400
          command: [/!*si %p 35 74, /!*si %p 351 74, /!*world larkspur, /!*user %p, /!*user addperm otherdrops.custom.wool1, /!*user rmperm otherdrops.custom.wool]
          consumetool: 1
          flags: UNIQUE
          permissions: wool
          message: "You've increased your max stack size for Wool/Dye to 74!"

This book when used on an enchantment table will increase the players stack size for all colors of wool and dye by 10. Its also removing and adding permissions to stop players from getting this same drop a second time while enabling them to get the next example to work properly. This is done in the exact way that the spell upgrade examples were done.

        - tool: WRITTEN_BOOK@400
          command: [/!*si %p 35 84, /!*si %p 351 84, /!*world larkspur, /!*user %p, /!*user addperm otherdrops.custom.wool2, /!*user rmperm otherdrops.custom.wool1]
          consumetool: 1
          permissions: wool1
          flags: UNIQUE
          message: "You've increased your max stack size for Wool/Dye to 84!"

As you can see the tool used is the same as the previous example, that is because they use a different permission for each drop that gets added to the player when the previous drop happens. This set up is useful for allowing players to change their own stack sizes, these books can be used as drops, boss drops, be sold or given out in events easily.


More Coming Soon

More examples will be added soon, for now I'm going to tidy the current ones up so it isn't a giant wall of text.


Comments

Posts Quoted:
Reply
Clear All Quotes