Skip to main content

Totem

Introduction

Welcome to Totem! Totem is a minecraft plugin that allows you to customize and craft different types of totems to save you from an inevitable demise. This guide will go over how to configure Totem and all of the options that you have.

Commands

/totem

Summary

The base totem command

Permission

totem.command

/totem give <totem-item>

Summary

Gives you a totem-item of the specified type

Arguments

<totem-item>: The id for the totem item you want to be given

Permission

totem.command.give

/pineapple-totem

Summary

My libraries internal commands for when things go wrong.

Permission

pineapple-lib.command

/pineapple-totem debug

Summary

provides subcommands with debug information that could be useful for debugging.

Permission

pineapple-lib.command.debug

/pineapple-totem debug version

Summary

provides version information for debugging purposes

Permission

pineapple-lib.command.debug.version

Configuration

Unlike most other plugins totem does a lot of its configuration in JSON. Json stands for JavaScript Object Notation. Writing JSON is an easier alternative that leaves you with clear linting when things go wrong. However, most generic text editors may not notify you of these errors. To ensure your JSON is valid before starting your server you can use JsonLint which will tell you if your JSON has any errors. Alternatively you can use VSCode, Brackets, Sublime and even Notepad++ can allow for seamless JSON editing.

Totem Settings | totem-settings.json

The crux to any totem using this plugin is its settings! I will be breaking down the fire totem settings as an example

  {
"id": "fire_totem_settings",
"damage-types": [
"in_fire",
"hot_floor",
"lava"
],
"given-effects": [
{
"type": "fire_resistance",
"duration": 1200,
"amplifier": 0,
"ambient": true,
"particles": true,
"icon": true
}
],
"standard-effects": true
}

ID

Every totem has an ID. ID allows my plugin to identify the difference between different settings. E.g. so fire_totem_settings isn't mixed up with magic_totem_settings.

Damage Types

Damage types are minecraft's internal way of knowing what type of damage was inflicted upon an entity. You can see a full list of these on the Minecraft Wiki. These Damage Types tell totem what we should save the dying player form. In the above example a player won't be saved by the totem if they die to a zombie, but if they fall in lava and burn to death the totem will resurrect them!

Given Effects

Given effects are a list of potion effects that can be given to the player when they are revived

Type

The type is the type of potion effect to be applied. What potion types and what there keys are can be found on the Minecraft Wiki.

Duration

The duration is how long the effect lasts for

warning

The duration is in TICKS not seconds or milliseconds. there are 20 ticks in a second!!!

info

While there is a default duration of 0 it is recommend you always fill out this field

Amplifier

The amplifier is the level of the potion e.g. Strength 2 has an amplifier of 1 and Strength 1 has an amplifier of 0. If this field is not filled out the amplifier defaults to 0 which gives a potion effect level of 1

warning

The "amplifier" starts at 0 instead of 1. E.g. a potion with amplifier of 0 is level 1 and a potion with amplifier of 1 is 2 and so on

Ambience

According to the spigot documentation ambience "Makes potion effect produce more, translucent, particles." By default this setting is true

Particles

This field determines whether or not to show particles of the potion effect by default this setting is true

Icon

According to the spigot documentation icon determines "whether an effect has an icon or not" by default this setting is true

Standard Effects

Standard effects describe the effects a totem usually gives you on revival. By default this is true.

info

Standard effects are applied on top of the potion effects that you add to these totem settings

Play Particles

Determines whether or ont to display the totem particles on revival. By default this is true

info

This is an all or none option totem particles are either displayed to all entities or not displayed at all, you can not just send them to the reviving player

Totem Items | totem-items.json

The next most important thing when considering totems is how they look. For this example we will again be using the fire totem so you can see how totem items and totem settings connect

  {
"id": "totem_of_fire",
"settings": "fire_totem_settings",
"item": {
"item_type": "TOTEM_OF_UNDYING",
"name": "<italic:!><gradient:#E0AD20:#EE4432>Totem of Fire",
"lore": [
"<color:gray>as death consumes you your skin will harden and the pain will fade"
]
}
}

ID

Unlike before the ID in totem items has a much more important meaning than an internal redirection so avoiding collisions in ID names are very important here. in this case totem_of_fire is the name of the item when using the /totem give command as well as the identifier added to specific totems. Messing with these IDs when totems are on your server will cause issues. In such a cases these special totems will then revert to being regular totems of undying

danger

Changing IDs when totems are already distributed within your player-base may cause irreversible damage!

Settings

This field is where you apply your settings earlier. This just redirects to the settings in your totem-settings.json You do not NEED to make your settings in the totem-settings.json and inlining it is also perfectly valid. An example is collapsed below

Settings Inlined example
  {
"id": "totem_of_fire",
"settings": {
"id": "fire_totem_settings",
"damage-types": [
"in_fire",
"hot_floor",
"lava"
],
"given-effects": [
{
"type": "fire_resistance",
"duration": 1200,
"amplifier": 0,
"ambient": true,
"particles": true,
"icon": true
}
],
"standard-effects": true
},
"item": {
"item_type": "TOTEM_OF_UNDYING",
"name": "<italic:!><gradient:#E0AD20:#EE4432>Totem of Fire",
"lore": [
"<color:gray>as death consumes you your skin will harden and the pain will fade"
]
}
}

Item

The item is how you can modify what the totem looks like or says in its title or lore!

danger

DO NOT TOUCH item_type IF THIS FIELD IS NOT TOTEM_OF_UNDYING THE TOTEM WILL TRIGGER TO FAIL! THIS IS NOT A BUG!

Items are enhanced by PineappleChat! You can check out how to use PineappleChat If you are familiar with MiniMessage you will find yourself at home, however make sure you still review the syntax as PineappleChat has slight deviations from MiniMessage.

Totem Recipes

Totem recipes allow for crafting these totems in survival. I will go over two examples one shapeless and one shaped recipe. First however I will explain fields used in every type of recipe

Key

The Key field is the internal name for the recipe it is very important to remember these CAN NOT collide the keys must be unique to any other key in the config. E.g. I can't have 2 recipes with the key totem_of_fire_recipe if this occurs only the second recipe defined will work as intended

Recipe Type

The recipe_type field is a required field which tells the code what type of recipe you are wanting. below are the currently supported recipe_type's

  • shaped
  • shapeless

Result

The result is the id of the totem item. No other items can be accepted. Only totem items will work. You can refer to the Totem Items section for more information on totem items

Shaped

  {
"key": "totem_of_fire_recipe",
"recipe_type": "shaped",
"result": "totem_of_fire",
"shape": [
"L","B","L",
"M","C","M",
"O","H","O"
],
"ingredients": {
"L": "lava_bucket",
"M": "magma_block",
"O": {
"item_type": "obsidian"
},
"C": "carved_pumpkin",
"H": "hay_block",
"B": "blaze_rod"
}
},

Shaped recipes work by having a "Shape" and mapping to a set of ingredients! First I will explain the shapeless

Shape

A Shape is a JSON array with no more and no less than 9 elements! below is an example of a shape that has empty spots in it

"shape": [
"C", "A", "C"
" ", "B", " "
" ", "B", " "
]

as you see the empty spaces are filled with " " space characters if you do not do this errors will occur

Ingredients

ingredients is the list of Materials/ItemStacks that map to a given to fill the shape. If an ingredient is not in the shape or the shape does not specify an ingredient an error will occur.

Currently Item Types or "Materials" are preferred over item stack declarations as they are more stable. If you have any questions regarding ItemStack decelerations or support for other plugins items please contact us in our support server

Shapeless

  {
"key": "totem_of_gravity_recipe",
"recipe_type": "shapeless",
"result": "totem_of_gravity",
"ingredients": [
"leather_boots",
"slime_block",
"carved_pumpkin",
"hay_block"
]
}

Ingredients

Unlike with shaped recipes shapeless recipes are a list versus a mapping as before while both ItemStacks and Item Types are supported Item Types are preferred currently for stability reasons.