How to upgrade your config
World conditionals from the previous versions, like this:
- 'if event.world.theMoon':
#or
- 'switch.event.world':
must be changed to
- 'if world.named.theMoon':
#or
- 'switch.world.named':
The internal format is
- '{world}.named.{worldName}'
#or
- 'switch.{world}.named':
This is hopefully to prepare for features such as 'it_target_world.named.theMoon'
The syntax using <
, >
, and =
is fine.
However,
- 'if target_maxhealth.greaterthanequals.damage'
must be changed to
- 'if target_maxhealth >= damage'
Respectively,
- 'if entity_fireticks.lessthan.5'
must be changed to
- 'if entity_fireticks < 5'
target
, entity
, fireticks
, and maxhealth
are just examples and can actually be many other things.
Message routines that use a message alias, like this:
- 'message.target._boom'
do not need to be changed.
If they do not use an alias
- 'message.target.KaBOOM!'
must be changed to
- 'message.target': 'KaBOOM!'
Also, the value interpolation syntax has changed. Any messages with values between % symbols
- 'message.target': 'HP: %target_health%/%target_maxhealth%'
must be changed to
- 'message.target': 'HP: %{target_health}/%{target_maxhealth}'
The advantage of this is that you can now use % in your messages without problems. You can also use the % (modulus) operator inside the expression if you want to.
This has been removed because it doesn't match up with other {entity}effect.*
routines.
- 'targeteffect.addfireticks': '5'
must be changed to
- 'set.target_fireticks': '+5'
Make sure for the add
effect routines that the value has a +
before it!
- 'targeteffect.sethealth': '100'
must be changed to
- 'set.target_health': '100'
If it makes more sense to you to use 'change' instead of 'set' above, you can. Also target
, fireticks
, and health
are just examples and can actually be many other things.
If the effect routine is not a set
or add
routine, then it does not need to be changed. This includes, for example, knockback
, hurt
, and spawn
.
- 'tag.target.super.1'
must be changed to
- 'tag.target.super': '1'
Most of the events were converted to a new way of specifying names internally, which means target
isn't the default entity name in most events anymore. In the Damage and Death events, there are still the target and attacker entities like normal, but in events like Spawn, for instance, you now use entity
instead of target
to refer to the entity being spawned.
If you were using event_value
before in your config, it will need to be replaced with the Integer with the (default) tag in the corresponding event.
See Events for more information. If you look at the error messages in the console, MD should suggest names you can use instead.
Because attacker
is an entity, checking things with attacker.type.FIRE
(for example) is no longer valid, because fire isn't an entity. So for all the "natural" damage sources that don't come from an entity, you must use damage.type.FIRE
(for example) instead.
This is a somewhat irritating change, but it actually makes things more flexible. If Bukkit ever creates new events to handle "magical" damage sources, like flaming arrows, potion effects, and enchantments, then it will be possible to do things like if attacker.type.player and damage.type.fire
.
For newer versions (greater than MD 340 or so), replace Damage.Type.{Source} with Damage_Type.is.{Source} Examples include Damage_Type.is.Poison or Damage_Type.is.Fall or Damage_Type.is.Lava