4 Adding a Superpower
Spyeedy edited this page 2019-06-16 17:05:28 +00:00

Superpowers are key features of LucraftCore. With an addonpack you can create your own by using a json-file with all required information. Here is an example:

{
	"name" : {
		"text": "Addon Pack Power"
	},

	"icon": {
		"type": "texture",
		"texture": "addonpack:textures/icons/icon.png"
	},
	
	"max_level": 10,
	
	"capsule_color" : 15073989,
	
	"effects": [
		{
			"type": "glow",
			"color": [ 1, 0.94, 0]
		}

	]
	
	"abilities": [
		{
			"ability": "lucraftcore:fire_resistance",
			"required_level": 5
		},
		{
			"ability": "heroesexpansion:lightning_attack",
			"key": 1
		},
		{
			"ability": "lucraftcore:healing",
			"frequency": 20,
			"amount": 5
		}
	
	]
}

On this page you can find a step-by-step explanation of each setting.

(* Optional)

name Sets the display name of your superpower. See name section for an explanation.

max level* Sets the max level of your superpower.
Default value is 0, meaning there is no level for your superpower.

capsule_color* Used to create an injection version of your superpower. It sets the color of the fluid in the injection. Color is a decimal value. Use the color mixer here.
Default value is 15073794.

icon* Sets the icon of your superpower. See icon section for an explanation.

effects* Sets special effects of your superpower. Like glow, to make the player glow. See adding effects page for more information.

abilities Sets the abilities available for your superpower. See abilities section for an explanation.

Name

Setting the name can be done by multiple ways. It's done by using TextComponents. You can get pretty creative and complex with them (as you can see here), but I will just cover the two most useful ways:

Normal text

As you can see in the example you can just a basic text that is going to displayed:

"name" : {
	"text": "Addon Pack Power"
}

In this case Addon Pack Power is the name to be displayed.

Translated text

To set the name depending on the language of the game you can the name to an unlocalized name:

"name" : {
	"translate": "addonpack.superpower.name"
}

Minecraft will try to translate addonpack.superpower.name into the current language. This requires you to create language files. For more information you can take a look at this.

Icon

The icon is the image that is going to be displayed in your inventory. There are two ways of adding an icon:

Item

For using an item as the icon you continue like you can see here:

"icon": {
	"type": "icon",
	"item": {
		"item": "minecraft:apple",
		"data": 0
	}
}

minecraft:apple is the registry name of the apple item while data is the metadata (you can leave the data-part if the metadata is 0)

Texture

You can also use a custom texture for the icon:

"icon": {
	"type": "texture",
	"texture": "addonpack:textures/icons/icon.png"
}

texture requires you to put in a resource location of the image file. It should be at 32x32 pixels and in the given example the image is located at assets/addonpack/textures/icons/icon.png.

Abilities

Adding abilities can be done in 2 ways:

  • Assigning each ability to a key
  • Array of abilities

You can add as many available abilities as you want. A more detailed description can be found here.