Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effect changes in 1.20.2 #50

Merged
merged 4 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion REGISTRY_LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* minecraft:instrument
* minecraft:item
* minecraft:loot_table
* minecraft:mob_effect (post-23w32a)
* minecraft:motive: Painting ID (pre-22w16a)
* minecraft:painting_variant: Painting ID (post-22w16a)
* minecraft:position_source_type
Expand All @@ -22,4 +23,4 @@
# Custom Registries
* custom:blockitemstates: block states based on the corresponding item ID
* custom:blockstates: block states based on the corresponding block ID
* custom:spawnitemtag: entity tags based on the corresponding spawn egg item iD
* custom:spawnitemtag: entity tags based on the corresponding spawn egg item iD
42 changes: 2 additions & 40 deletions minecraft/block/beacon.nbtdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,9 @@ compound Beacon extends super::BlockEntity {
/// The number of levels from the pyramid
Levels: int,
/// The primary potion effect of the beacon
Primary: EffectId,
primary_effect: id(minecraft:mob_effect),
/// The secondary potion effect of the beacon
Secondary: EffectId
}

/// Numerical ids for effects
enum(int) EffectId {
None = -1,
Speed = 1,
Slowness = 2,
Haste = 3,
MiningFatigue = 4,
Strength = 5,
InstantHealth = 6,
InstantDamage = 7,
JumpBoost = 8,
Nausea = 9,
Regeneration = 10,
Resistance = 11,
FireResistance = 12,
WaterBreathing = 13,
Invisibility = 14,
Blindness = 15,
NightVision = 16,
Hunger = 17,
Weakness = 18,
Poison = 19,
Wither = 20,
HealthBoost = 21,
Absorption = 22,
Saturation = 23,
Glowing = 24,
Levitation = 25,
Luck = 26,
UnLuck = 27,
SlowFalling = 28,
ConduitPower = 29,
DolphinsGrace = 30,
BadOmen = 31,
HeroOfTheVillage = 32,
Darkness = 33
secondary_effect: id(minecraft:mob_effect)
}

Beacon describes minecraft:block[minecraft:beacon];
4 changes: 2 additions & 2 deletions minecraft/entity/effectcloud.nbtdoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ compound EffectCloud extends super::EntityBase {
/// The default potion effect
Potion: id(minecraft:potion),
/// The potion effects that get applied on use
Effects: [PotionEffect]
effects: [PotionEffect]
}

EffectCloud describes minecraft:entity[minecraft:area_effect_cloud];
EffectCloud describes minecraft:entity[minecraft:area_effect_cloud];
10 changes: 4 additions & 6 deletions minecraft/entity/mob/breedable/mooshroom.nbtdoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
use ::minecraft::util::EffectId;
use ::minecraft::item::suspiciousstew::SuspiciousEffect;

compound Mooshroom extends super::Breedable {
/// The type of the mooshroom
Type: Type,
/// The effect that the mooshroom gives to suspicious stew
EffectId: EffectId,
/// The duration of the suspicious stew effect
EffectDuration: int
/// The effects that the mooshroom gives to suspicious stew
stew_effects: [SuspiciousEffect]
}

enum(string) Type {
Red = "red",
Brown = "brown"
}

Mooshroom describes minecraft:entity[minecraft:mooshroom];
Mooshroom describes minecraft:entity[minecraft:mooshroom];
2 changes: 1 addition & 1 deletion minecraft/entity/mob/mod.nbtdoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ compound LivingEntity extends super::EntityBase {
/// The mob's attributes
Attributes: [Attribute],
/// The active potion effects on the mob
ActiveEffects: [PotionEffect],
active_effects: [PotionEffect],
/// Whether the mob should have an AI
NoAI: boolean,
/// The team to join when the mob is spawned
Expand Down
2 changes: 1 addition & 1 deletion minecraft/entity/projectile/arrow.nbtdoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ compound Arrow extends ArrowBase {
/// calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive
Color: int,
/// The custom potion effects to give to the hit entity
CustomPotionEffects: [PotionEffect],
custom_potion_effects: [PotionEffect],
/// The name of the default potion effect
Potion: id(minecraft:potion),
/// The color of the arrow's particles
Expand Down
4 changes: 2 additions & 2 deletions minecraft/item/potion.nbtdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use ::minecraft::util::PotionEffect;
/// An item that has a potion effect
compound EffectItem extends super::ItemBase {
/// A list of the potion effects that will be used with this item
CustomPotionEffects: [PotionEffect],
custom_potion_effects: [PotionEffect],
/// The name of the default potion effect
Potion: id(minecraft:potion),
/// Color of this item
/// calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive
CustomPotionColor: int
}
}
12 changes: 5 additions & 7 deletions minecraft/item/suspiciousstew.nbtdoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use ::minecraft::util::EffectId;

/// A suspicious stew item
compound SuspiciousStew extends super::ItemBase {
/// The effects this stew will give
Effects: [Effect]
effects: [SuspiciousEffect]
}

/// A suspicious stew effect
compound Effect {
compound SuspiciousEffect {
/// The id of the effect
EffectId: EffectId,
id: id(minecraft:mob_effect),
/// The duration of the effect in ticks
EffectDuration: int @ 1..
}
duration: int @ 1..
}
58 changes: 16 additions & 42 deletions minecraft/util/effect.nbtdoc
Original file line number Diff line number Diff line change
@@ -1,51 +1,25 @@
/// A single potion effect
compound PotionEffect {
Id: EffectId,
id: id(minecraft:mob_effect),
/// Whether the effect particles are semi-transparent (like with a Beacon)
Ambient: boolean,
Amplifier: byte,
Duration: int,
ambient: boolean,
amplifier: byte,
duration: int,
/// A lower amplifier effect of the same type.
HiddenEffect: PotionEffect,
hidden_effect: PotionEffect,
/// Whether the effect particles should be shown
ShowParticles: boolean,
show_particles: boolean,
/// Whether the effect icon should be shown
ShowIcon: boolean
show_icon: boolean,
factor_calculation_data: FactorData
}

/// Numerical ids for effects
enum(int) EffectId {
Speed = 1,
Slowness = 2,
Haste = 3,
MiningFatigue = 4,
Strength = 5,
InstantHealth = 6,
InstantDamage = 7,
JumpBoost = 8,
Nausea = 9,
Regeneration = 10,
Resistance = 11,
FireResistance = 12,
WaterBreathing = 13,
Invisibility = 14,
Blindness = 15,
NightVision = 16,
Hunger = 17,
Weakness = 18,
Poison = 19,
Wither = 20,
HealthBoost = 21,
Absorption = 22,
Saturation = 23,
Glowing = 24,
Levitation = 25,
Luck = 26,
UnLuck = 27,
SlowFalling = 28,
ConduitPower = 29,
DolphinsGrace = 30,
BadOmen = 31,
HeroOfTheVillage = 32,
Darkness = 33
compound FactorData {
padding_duration: int @ 0..,
factor_start: float,
factor_target: float,
factor_current: float,
ticks_active: int @ 0..,
factor_previous_frame: float,
had_effect_last_tick: boolean
}
3 changes: 1 addition & 2 deletions minecraft/util/mod.nbtdoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ mod blockstate;
export use any::Any;
export use slot::Slot;
export use effect::PotionEffect;
export use effect::EffectId;
export use color::Color;
export use bannerpattern::BannerPattern;
export use invitem::InventoryItem;
export use invitem::SlottedItem;
export use blockstate::BlockState;
export use blockstate::BlockState;
3 changes: 2 additions & 1 deletion test/src/registries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ minecraft:frog_variant
minecraft:game_event
minecraft:instrument
minecraft:loot_table
minecraft:mob_effect
minecraft:painting_variant
minecraft:position_source_type
minecraft:potion
minecraft:structure
minecraft:villager_profession
minecraft:villager_type
minecraft:villager_type