Interface MobEffectDefinition
An effect a plugin adds to the game, created by
MobEffectRegistry.define(TypedKey).
minecraft:mob_effect is baked into the client: a vanilla client only knows the vanilla
effects, by their network ID, and drops the connection on an ID it does not know. So a new effect is
shown to a player in one of three ways:
- its own ID, to the players whose (modded) client knows it;
- else the vanilla effect it falls back to, so the icon still shows;
- else not at all: the effect only exists on the server.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilds aMobEffectDefinition.static enumWhether an effect helps or harms, as vanilla sorts them. -
Method Summary
Modifier and TypeMethodDescriptionReturns what the effect does.category()Returns whether the effect helps or harms.fallback()Returns the vanilla effect shown to players whose client does not know this one, empty to show nothing.booleanReturnstrueif the client of this player knows the effect, and receives its own ID.key()Returns the key of the effect.Returns the network ID asked for, empty to take the next free ID after the vanilla effects.
-
Method Details
-
key
-
category
MobEffectDefinition.Category category()Returns whether the effect helps or harms.- Returns:
- whether the effect helps or harms
- Since:
- 0.1.0
-
fallback
-
isKnownBy
Returnstrueif the client of this player knows the effect, and receives its own ID.- Parameters:
player- the player about to be told about the effect- Returns:
trueif the client of this player knows the effect, and receives its own ID- Since:
- 0.1.0
-
requestedNetworkId
OptionalInt requestedNetworkId()Returns the network ID asked for, empty to take the next free ID after the vanilla effects.- Returns:
- the network ID asked for, empty to take the next free ID after the vanilla effects
- Since:
- 0.1.0
-
behaviour
MobEffectBehaviour behaviour()Returns what the effect does.- Returns:
- what the effect does
- Since:
- 0.1.0
-