Effects are what trinkets use. They can be things like a potion effect, a damage modification, or some other examples. There are both positive and negative (harmful) effects.
Effects form the most important resource of this mod. At the time of writing there are currently 7 possible types of effects:
mobeffect: one of the Minecraft (or modded) mob effects like regeneration, weakness, ...
potionresistance: with this type the player will resist a negative potion effect (like weakness or blindness)
damagereduction: using this type you can resist a percentage of damage for a give damage type
attribute: buff or debuff on a specific attribute (like reach, attack damage, movements speed, ...)
flight: gives creative flight
warp: allows the player to warp (teleport) somewhere
cure: removes all negative potion effects on the player
growtick: do random ticks around the player. Increases growticks
Effects can also have an associated
toggle which allows them to be turned on or off
and effects can also have an associated
hotkey. A hotkey doesn't imply that the
effect needs a toggle as well as a hotkey can also be a one-time usage (like with the
The general syntax for an effect is as follows:
"toggle": "<some name>", // Optional
"hotkey": <some number>, // Optional
"harmful": true, // Optional
"type": "<type>", // Required: One of the types described above
... // Type specific parameters
The name after the
toggle represents the name of a boolean value that is kept with the player.
Usually when you specify this you also need a hotkey so that you can enable or disable
The hotkey is a number between 1 and 8 (there are 8 possible hotkeys).
Mobeffects correspond to potion effects. Here is an example:
The important type specific parameters are
effectId can be any vanilla or modded potion effect.
Here is another example for a nightvision effect that can be toggled with a hotkey:
With the potion resistance effect you can resist negative potion effects. Here is an example:
With the damage reduction effect you can reduce damage from a specific damage source. The following vanilla damage sources are supported:
Here is an example where wither damage is reduced 75%:
It's also possible to make a harmful version of this effect like this:
With this effect you can buff or debuff various player attributes temporarily. The following attributes are supported:
The attribute effect has
operation parameters. With these you can control
what happens with the actual value of the attribute. The following operations are
addition: add the given
amountto the attribute value
multiply_base: multiply base value with the given
multiply_total: multiply the total value with the given
Here is an example of a health boost effect:
And here is a harmful movement speed effect:
The flight effect is very simple. It gives creative flight. It has no special parameters:
The warp effect allows the player to teleport forward a configurable amount. It needs a hotkey to properly function:
With the cure effect all negative potion effects will be canceled:
With the growtick effect you can increase random ticks around the player. This will increase the speed at which crops grow.
blocks is the number of blocks that will be ticked and
maxdist is how far it will do
this horizontally. Vertically it always goes from -3 to 3 around the player.
There are lot of default effects already included with the mod. You can find all of them here (https://github.com/McJtyMods/FancyTrinkets/tree/1.19/src/generated/resources/data/fancytrinkets/fancytrinkets/effects). Here is a short summary.
- Potion effects like
- +25% damage increase effects like
- Negative attribute effects like
- Potion effects like
- Special effects like
- Potion resist effects like
- Damage reduction effects like
- Positive attribute effects like