Alias Management

Alias Management

On this page, I will explain to you in as much detail as possible how to set up your sound effects and their aliases. It's fairly simple, but you must pay attention, read everything on the page, and ask if you aren't sure.

I want to direct your attention to this page HERE. You will see some Java code that you most likely don't understand. No offense if you do, and don't panic if you don't. The section you need is all of the words in full capital letters, for example, AMBIENCE_CAVE or AMBIENCE_RAIN. These are known as enumerators, and are what the code on ChatSounds is based on.

In your config.yml, you will (hopefully) see a section labelled 'aliases'. This is where we will be working. By default, it should look like this:

aliases:
  explode:
  - explode
  - boom
  - tnt
  cat_meow:
  - meow
  cat_purr:
  - purr
  cat_purreow:
  - purreow
  cow_idle:
  - cow
  - moo

You may have already noticed that each of the suboptions in 'aliases' can be found in that Sound.java page that I linked to you. Do you see where I'm going yet?

Let's say you want to add the sound of a chest being opened to ChatSounds. Looking at the GitHub page I linked, you should be able to see CHEST_OPEN. It's clear what this sound means, right? In your config.yml, in the aliases section, add "chest_open:", making sure you keep the correct indentation. We'll add it to the top of our list so we can show a little less of the config.

aliases:
  chest_open:  <-- HERE IT IS
  explode:
  - explode
  - boom
  - tnt

Now underneath the "chest_open:" you just added, you can add the aliases that you want to trigger the sound effect. We'll add the phrase "open chest".

aliases:
  chest_open:
  - open chest
  explode:
  - explode
  - boom
  - tnt

And that's really all there is to it. Do this for as many sound effects as you want and even add as many aliases as you want. How much simpler could you want it?

As an added bonus to the code, I added a few extra lines so that you can reload the config without having to restart your server. Just do the command "/chatsounds reload" in game or in the console and all of the new sound effects that you added will be loaded and ready for use.


Comments

Posts Quoted:
Reply
Clear All Quotes