Repository navigation
Effects
Fire, explosions, TNT, weather and particles right in the UI.
FxLayer is an effects layer you can put on top of anything (for example, in a StackLayout).
fx.spawn(VanillaFx.fire(x, y, 32, 32)); // fire; .stop() fades it out
fx.spawn(VanillaFx.soulFire(x, y, 32, 32));
fx.spawn(VanillaFx.explosion(cx, cy, 1f)); // fireballs, flash, smoke, sparks, sound
fx.spawn(VanillaFx.primedTnt(x, -20, floorY, 22, 3f) // falls, bounces, flashes, explodes
.velocity(40, 0).onExplode(() -> panel.play(VanillaFx.shake(panel, 6, 0.5f))));
fx.spawn(VanillaFx.flames(x, y, 24)); fx.spawn(VanillaFx.lavaPop(x, y, 14)); fx.spawn(VanillaFx.smokePuff(x, y, 20));Weather and particles:
-
snowandrainuse the vanilla precipitation textures in two layers, plus flakes, drops and splashes;cherryLeaves,drips(water or lava),bubbles. - Particles:
hearts,angry,happy,note(color depends on the note pitch),crit(normal and magic),totem,enchant(runes pulled toward a point).
Effects use vanilla textures and sounds by id, so they pick up the player's resource packs.
Registry by name. All built-in effects are registered as minecraft:*. Add your own in one line:
FxRegistry.register("mymod:confetti", (x, y, w, h) -> new Particles(null).gravity(140).wobble(30, 1.2f)
.emitter((p, r, dt) -> p.emit(x + r.nextFloat() * w, y, 0, 40, 2f, 2f, Color.hsv(r.nextFloat() * 360, 0.7f, 1)), 3f));
fx.spawn("mymod:confetti"); // over the whole layer
fx.spawn("minecraft:snow", x, y, w, h); // a built-in one by nameOptions for your own particles (Particles): gravity, drag, growth, tint, blend, wobble (sway),
attract (pull toward a point), floor and ceiling (with a landing handler), streak (dashes along velocity),
frames(BY_LIFE | LOOP | RANDOM), emitter. Without a sprite (new Particles(null)) particles are drawn as pixel squares.
Effects can be combined: Effect.group(a, b). An effect without its own class: Effect.of(tick, render).
For animated textures there is SpriteSheet.
new Backdrop(Backdrop.Kind.PARTICLES)
.particles(Backdrop.ParticleStyle.SNOW) // SPARKS, SNOW, DUST
.particleCount(90)
.repel(60f, 900f) // cursor repel radius and strength
.speed(1f);Sparks rise and fade (drawn with additive blending), snow falls and sways, dust drifts slowly. The cursor pushes
particles away, then they smoothly return to their speed. Your own colors: colors(...).
← Maps · English home · Blur, Clipping and GIF →
Начало работы: Установка · Первый экран
Основы: Раскладка · Стили и темы · Цвета и градиенты · Анимации · Данные и сигналы · События и ввод
Виджеты: Каталог виджетов · Всплывающие окна · Формы · Markdown и книги
Игра: Инвентарь и слоты · Окна-контейнеры · Мобы, предметы и 3D · HUD · Карты
Оформление: Эффекты · Размытие, обрезка и GIF
HTML и CSS: HTML и CSS
Возможности: Языки · Экран настроек · Доступность и звуки
Для продвинутых: Расширение · Отладка и советы · Архитектура
Getting started: Installation · Your First Screen
Basics: Layout · Styles and Themes · Colors and Gradients · Animations · Data and Signals · Events and Input
Widgets: Widget Catalog · Popups · Forms · Markdown and Books
Game: Inventory and Slots · Container Screens · Mobs, Items and 3D · HUD Overlay · Maps
Visuals: Effects · Blur, Clipping and GIF
HTML and CSS: HTML and CSS
Features: Languages · Config Screen · Accessibility and Sounds
Advanced: Extending · Debugging and Tips · Architecture