BossEvent .java

net.minecraft.world.BossEvent (class, 146 lines): members: shouldPlayBossMusic, BossBarOverlay, BossBarColor, getOverlay, shouldCreateWorldFog, setOverlay.

net.minecraft.worldclass146 linescommon3.3 KB

API Surface (20)

UUID getId()
Component getName()
void setName(final Component name)
float getProgress()
void setProgress(final float progress)
BossEvent.BossBarColor getColor()
void setColor(final BossEvent.BossBarColor color)
BossEvent.BossBarOverlay getOverlay()
void setOverlay(final BossEvent.BossBarOverlay overlay)
boolean shouldDarkenScreen()
BossEvent setDarkenScreen(final boolean darkenScreen)
boolean shouldPlayBossMusic()
BossEvent setPlayBossMusic(final boolean playBossMusic)
BossEvent setCreateWorldFog(final boolean createWorldFog)
boolean shouldCreateWorldFog()
ChatFormatting getFormatting()
String getName()
String getSerializedName()
String getName()
String getSerializedName()

Fields & Constants (8)

id
name
progress
color
overlay
darkenScreen
playBossMusic
createWorldFog

String literals (11)

"pink"
"blue"
"green"
"yellow"
"purple"
"white"
"progress"
"notched_6"
"notched_10"
"notched_12"
"notched_20"

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

BossEvent.java146 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world;
2
3
import com.mojang.serialization.Codec;
4
import java.util.UUID;
5
import net.minecraft.ChatFormatting;
6
import net.minecraft.network.chat.Component;
7
import net.minecraft.util.StringRepresentable;
8
9
public abstract class BossEvent {
10
	private final UUID id;
11
	protected Component name;
12
	protected float progress;
13
	protected BossEvent.BossBarColor color;
14
	protected BossEvent.BossBarOverlay overlay;
15
	protected boolean darkenScreen;
16
	protected boolean playBossMusic;
17
	protected boolean createWorldFog;
18
19
	public BossEvent(final UUID id, final Component name, final BossEvent.BossBarColor color, final BossEvent.BossBarOverlay overlay) {
20
		this.id = id;
21
		this.name = name;
22
		this.color = color;
23
		this.overlay = overlay;
24
		this.progress = 1.0F;
25
	}
26
27
	public UUID getId() {
28
		return this.id;
29
	}
30
31
	public Component getName() {
32
		return this.name;
33
	}
34
35
	public void setName(final Component name) {
36
		this.name = name;
37
	}
38
39
	public float getProgress() {
40
		return this.progress;
41
	}
42
43
	public void setProgress(final float progress) {
44
		this.progress = progress;
45
	}
46
47
	public BossEvent.BossBarColor getColor() {
48
		return this.color;
49
	}
50
51
	public void setColor(final BossEvent.BossBarColor color) {
52
		this.color = color;
53
	}
54
55
	public BossEvent.BossBarOverlay getOverlay() {
56
		return this.overlay;
57
	}
58
59
	public void setOverlay(final BossEvent.BossBarOverlay overlay) {
60
		this.overlay = overlay;
61
	}
62
63
	public boolean shouldDarkenScreen() {
64
		return this.darkenScreen;
65
	}
66
67
	public BossEvent setDarkenScreen(final boolean darkenScreen) {
68
		this.darkenScreen = darkenScreen;
69
		return this;
70
	}
71
72
	public boolean shouldPlayBossMusic() {
73
		return this.playBossMusic;
74
	}
75
76
	public BossEvent setPlayBossMusic(final boolean playBossMusic) {
77
		this.playBossMusic = playBossMusic;
78
		return this;
79
	}
80
81
	public BossEvent setCreateWorldFog(final boolean createWorldFog) {
82
		this.createWorldFog = createWorldFog;
83
		return this;
84
	}
85
86
	public boolean shouldCreateWorldFog() {
87
		return this.createWorldFog;
88
	}
89
90
	public enum BossBarColor implements StringRepresentable {
91
		PINK("pink", ChatFormatting.RED),
92
		BLUE("blue", ChatFormatting.BLUE),
93
		RED("red", ChatFormatting.DARK_RED),
94
		GREEN("green", ChatFormatting.GREEN),
95
		YELLOW("yellow", ChatFormatting.YELLOW),
96
		PURPLE("purple", ChatFormatting.DARK_BLUE),
97
		WHITE("white", ChatFormatting.WHITE);
98
99
		public static final Codec<BossEvent.BossBarColor> CODEC = StringRepresentable.fromEnum(BossEvent.BossBarColor::values);
100
		private final String name;
101
		private final ChatFormatting formatting;
102
103
		BossBarColor(final String name, final ChatFormatting formatting) {
104
			this.name = name;
105
			this.formatting = formatting;
106
		}
107
108
		public ChatFormatting getFormatting() {
109
			return this.formatting;
110
		}
111
112
		public String getName() {
113
			return this.name;
114
		}
115
116
		@Override
117
		public String getSerializedName() {
118
			return this.name;
119
		}
120
	}
121
122
	public enum BossBarOverlay implements StringRepresentable {
123
		PROGRESS("progress"),
124
		NOTCHED_6("notched_6"),
125
		NOTCHED_10("notched_10"),
126
		NOTCHED_12("notched_12"),
127
		NOTCHED_20("notched_20");
128
129
		public static final Codec<BossEvent.BossBarOverlay> CODEC = StringRepresentable.fromEnum(BossEvent.BossBarOverlay::values);
130
		private final String name;
131
132
		BossBarOverlay(final String name) {
133
			this.name = name;
134
		}
135
136
		public String getName() {
137
			return this.name;
138
		}
139
140
		@Override
141
		public String getSerializedName() {
142
			return this.name;
143
		}
144
	}
145
}
146

Decompiled Minecraft 26.3 source of BossEvent (net/minecraft/world/BossEvent.java) with Mojang official mappings, stored verbatim on the site.