CushionScreens
将一面软垫墙变成一块可用的屏幕。在 Minecraft 世界中直接显示静态图片、动画 GIF 和视频——并带有同步音频。直接从 URL 加载内容,像媒体播放器一样控制播放(暂停、恢复、跳转、循环、音量),并选择屏幕能显示的颜色数量。
功能
- 图片、GIF 和视频 - 任何 FFmpeg/Java 图像库能读取的文件。
- 音频 - 视频播放可以将同步音频流式传输到玩家的游戏客户端(无需资源包),支持通过命令单独控制音量。
- 直接从 URL 加载 -
/cushionscreens url <link> 从网络下载并直接显示图片或 GIF。
- 最多 176 种颜色 - 不仅仅是 16 种软垫染料颜色,模组可以在每个软垫下方放置不同的发光方块(不同氧化阶段的铜灯泡、燃烧中的熔炉、重生锚、哭泣的黑曜石、幽匿催化器、岩浆块……)以获得每种颜色的额外亮度级别。即使没有此功能,每个屏幕在夜间默认也会发光。
- 播放控制 -
pause/resume 冻结和继续在你离开的位置(无需重新加载),loop 无限重复视频/GIF(及音频)而不是停在空白屏幕上,seek 跳转到视频的某一部分。
- 三种缩放模式 - 拉伸以完全填充、裁剪以无失真填充,或适配并添加黑边。
- 重启后保留 - 已构建的屏幕会在服务器重启和重新加入时被记住;无需重建。
- 烘焙 (Bake) - 将特定图像转换为永久、不受管理的图片,然后在其他地方构建新屏幕。
- 命令钩子 - 其他命令/数据包可以通过记分板值检查当前是否有内容正在播放,例如用于
/execute if score。
要求
|
|
| Minecraft |
26.3-snapshot-3 |
| Fabric Loader |
>=0.19.3 |
| Fabric API |
必需 |
| Java |
25+ |
| 环境 |
客户端和服务端均需安装(音频播放和渲染距离修复在客户端运行) |
| FFmpeg |
仅对 /video 及其音频必需 - 必须安装并在 PATH 中可用。图片、GIF 和 URL 不需要它。 |
快速开始
/cushionscreens build <width> <height>
在你面前直接构建一个屏幕。将你的图片/GIF/视频放入游戏/服务器目录内的 cushionscreens/ 文件夹中(首次使用时会自动创建),然后:
/cushionscreens image cat.png
/cushionscreens gif dance.gif
/cushionscreens video 20 trailer.mp4
/cushionscreens url
完整命令列表
| 命令 |
描述 |
/cushionscreens build <width> <height> |
在你面前创建一个屏幕 |
/cushionscreens image <file> [{attrs}] |
显示一张图片 |
/cushionscreens gif <file> [{attrs}] |
播放一个 GIF |
/cushionscreens url <link> [{attrs}] |
显示来自直接 http(s) 链接的图片或 GIF |
/cushionscreens video <fps> <file> [{attrs}] |
播放视频(需要 FFmpeg) |
/cushionscreens video <fps> <file> audio [targets] [{attrs}] |
带声音播放,可选择仅针对 @a/@p/某个玩家 |
/cushionscreens play <pattern> <speed> |
播放生成的动画:plasma、rainbow、bars 或 noise |
/cushionscreens pause |
冻结当前帧/图案(及音频) |
/cushionscreens resume |
从暂停处继续播放 |
/cushionscreens stop |
停止当前正在播放的内容 |
/cushionscreens clear |
完全移除屏幕 |
/cushionscreens range <chunks> |
设置屏幕的渲染距离,然后重建以应用更改 |
/cushionscreens maxframes <number> |
解码的最大视频帧数(默认 2000) |
/cushionscreens help |
游戏内命令参考 |
属性
属性放在文件/URL 之后(对于视频则是 audio/目标之后),以 NBT 复合结构编写——与 Minecraft 物品组件使用的风格相同:
/cushionscreens video 20 clip.mp4 audio @a {colors:176,loop:true,volume:75,seek:30,scaling:fit}
| 键 |
值 |
适用对象 |
描述 |
colors |
16(默认)、17、64、80、176 |
image, gif, video, url |
使用的颜色组合数量 - 见下文 |
bake |
true |
仅限 image |
显示它,然后停止将其作为屏幕进行管理(见下文) |
loop |
true |
gif, video, url (gif) |
无限重复(包括音频)而不是停在空白屏幕上 |
volume |
0-100 |
video (with audio) |
播放音量,独立于 Minecraft 自身的音效滑块 |
seek |
秒数 |
video |
从文件的中间部分开始播放(及音频) |
scaling |
stretch(默认)、crop、fit |
image, gif, video, url |
如何适应与屏幕宽高比不匹配的内容 |
颜色
每个屏幕默认都坐落在一盏点亮的涂蜡铜灯泡上(16 种颜色,夜间发光)。更高的值以性能换取更宽的色彩范围——改变软垫下方的方块比仅仅改变其颜色昂贵得多,因此在较高的颜色计数下,尤其是在大屏幕的 /video 和 /gif 上,可能会出现更多卡顿。静态 /image 受影响较小,因为它是单次更改。
16 - 默认,仅是软垫颜色。
17 - 16 种默认颜色加上一种真正的黑色(在非发光方块上的黑色软垫,因为在发光方块上的黑色并非完全黑)。
64 - 在每个软垫下增加 4 种铜灯泡氧化阶段。
80 - 上述 64 种,加上每种颜色的非发光变体。
176 - 每个软垫下的所有 11 种支持的亮度级别方块。
缩放
stretch - 完全填充屏幕,如果宽高比与屏幕不匹配可能会扭曲图像。
crop - 缩放以完全填充屏幕而不变形,裁剪溢出边缘。
fit - 缩放以适应屏幕内部而不变形或裁剪;剩余空间用黑条填充(信箱格式/柱状格式)。
烘焙
/cushionscreens image cat.png {bake:true}
正常显示图片后,模组会“忘记”该区域是屏幕——垫子和方块将永远保持原样,不受 /stop、/clear 或后续 /image//video//gif 调用的影响,也不会被追踪以在重启后恢复。使用此功能可永久固定一张图片,并为屏幕腾出空间用于其他用途。
从其他命令/数据包检查播放状态
模组会通过记分板值同步当前是否有内容正在播放:
/execute if score CushionScreens cc_playing matches 1 run say something is playing!
已知限制
- 一次仅能追踪一个屏幕。
colors:64/80/176/17 所使用的颜色值基于游戏内实际测量,但在未来更新中仍可能进一步优化。
- 循环音频独立于视频循环运行,且未显式重新同步,因此超长循环可能会随时间推移略微不同步。
- 服务器重启后,若相关区域尚未加载,恢复保存的屏幕可能需要一定时间(最长约 60 秒,之后放弃)。
/cushionscreens url 仅支持图片和 GIF,不支持视频或直播流。
许可证
MIT
CushionScreens
Turn a wall of cushions into a working screen. Show static images, animated GIFs, and videos - with synced audio - directly inside your Minecraft world. Load content straight from a URL, control playback like a media player (pause, resume, seek, loop, volume), and pick how many colors the screen can show.
Features
- Images, GIFs, and video - any file FFmpeg/Java's image libraries can read.
- Audio - video playback can stream synced audio to players' game clients (no resource pack needed), with per-command volume control.
- Load directly from a URL -
/cushionscreens url <link> downloads and displays an image or GIF straight from the web.
- Up to 176 colors - instead of just the 16 cushion dye colors, the mod can place a different light-emitting block underneath each cushion (copper bulbs in various oxidation stages, a lit furnace, a respawn anchor, crying obsidian, a sculk catalyst, a magma block...) to get extra brightness levels per color. Every screen glows at night by default, even without this.
- Playback controls -
pause/resume freeze and continue exactly where you left off (no reloading), loop repeats video/GIF (and audio) forever instead of stopping on a blank screen, seek jumps partway into a video.
- Three scaling modes - stretch to fill exactly, crop to fill without distortion, or fit with letterboxed black bars.
- Survives restarts - a built screen is remembered across server restarts and rejoining; no need to rebuild it.
- Bake - turn a specific image into a permanent, un-managed picture, then build a new screen somewhere else.
- Command hook - other commands/datapacks can check whether something is currently playing via a scoreboard value, e.g. for
/execute if score.
Requirements
|
|
| Minecraft |
26.3-snapshot-3 |
| Fabric Loader |
>=0.19.3 |
| Fabric API |
Required |
| Java |
25+ |
| Environment |
Client AND server both required (audio playback and a render-distance fix run on the client) |
| FFmpeg |
Required only for /video and its audio - must be installed and available on PATH. Images, GIFs, and URLs don't need it. |
Getting started
/cushionscreens build <width> <height>
Builds a screen directly in front of you. Put your images/GIFs/videos in the cushionscreens/ folder inside your game/server directory (created automatically on first use), then:
/cushionscreens image cat.png
/cushionscreens gif dance.gif
/cushionscreens video 20 trailer.mp4
/cushionscreens url
Full command list
| Command |
Description |
/cushionscreens build <width> <height> |
Create a screen in front of you |
/cushionscreens image <file> [{attrs}] |
Show an image |
/cushionscreens gif <file> [{attrs}] |
Play a GIF |
/cushionscreens url <link> [{attrs}] |
Show an image or GIF from a direct http(s) link |
/cushionscreens video <fps> <file> [{attrs}] |
Play a video (needs FFmpeg) |
/cushionscreens video <fps> <file> audio [targets] [{attrs}] |
Play with sound, optionally only for @a/@p/a player |
/cushionscreens play <pattern> <speed> |
Play a generated animation: plasma, rainbow, bars, or noise |
/cushionscreens pause |
Freeze the current frame/pattern (and audio) |
/cushionscreens resume |
Continue exactly where it was paused |
/cushionscreens stop |
Stop whatever is currently playing |
/cushionscreens clear |
Remove the screen entirely |
/cushionscreens range <chunks> |
Set how far away the screen renders from, then rebuild to apply |
/cushionscreens maxframes <number> |
Max video frames to decode (default 2000) |
/cushionscreens help |
In-game command reference |
Attributes
Attributes go after the file/URL (and after audio/targets for video), written as an NBT compound - the same style Minecraft uses for item components:
/cushionscreens video 20 clip.mp4 audio @a {colors:176,loop:true,volume:75,seek:30,scaling:fit}
| Key |
Values |
Applies to |
Description |
colors |
16 (default), 17, 64, 80, 176 |
image, gif, video, url |
How many color combinations to use - see below |
bake |
true |
image only |
Show it, then stop managing it as a screen (see below) |
loop |
true |
gif, video, url (gif) |
Repeat forever (audio too) instead of stopping on a blank screen |
volume |
0-100 |
video (with audio) |
Playback volume, independent of Minecraft's own sound sliders |
seek |
seconds |
video |
Start playback (and audio) partway into the file |
scaling |
stretch (default), crop, fit |
image, gif, video, url |
How to fit content that doesn't match the screen's aspect ratio |
Colors
Every screen always sits on a lit waxed copper bulb by default (16 colors, glows at night). Higher values trade performance for a wider color range - changing the block under a cushion is much more expensive than just changing its color, so expect more lag at higher color counts, especially on /video and /gif with large screens. Static /image is far less affected since it's a one-time change.
16 - default, just the cushion colors.
17 - the 16 default colors plus one true black (a black cushion on a non-glowing block, since black on a lit block isn't fully black).
64 - adds the 4 copper bulb oxidation stages under each cushion.
80 - the 64 above, plus a non-glowing variant for each color.
176 - all 11 supported light-level blocks under each cushion.
Scaling
stretch - fills the screen exactly, may distort the image if its aspect ratio doesn't match the screen.
crop - scales to fill the screen completely without distortion, cropping whichever edge overflows.
fit - scales to fit entirely within the screen without distortion or cropping; leftover space is filled with black bars (letterbox/pillarbox).
Bake
/cushionscreens image cat.png {bake:true}
Shows the image like normal, then the mod "forgets" that spot is a screen - the cushions and blocks stay exactly as they are forever, unaffected by /stop, /clear, or future /image//video//gif calls, and aren't tracked for restart persistence. Use this to permanently commit a picture and free up the screen for something else.
Checking playback state from other commands/datapacks
The mod keeps a scoreboard value in sync with whether anything is currently playing:
/execute if score CushionScreens cc_playing matches 1 run say something is playing!
Known limitations
- Only one screen is tracked at a time.
- The color values used for
colors:64/80/176/17 are based on real in-game measurements, but may still be refined in future updates.
- Looped audio runs independently from the video loop and isn't explicitly resynced, so very long loops may drift slightly out of sync over time.
- After a server restart, restoring a saved screen can take a little while if the area isn't already loaded (up to ~60 seconds before it gives up).
/cushionscreens url supports images and GIFs only, not video/live streams.
License
MIT
评论 0
登录后参与评分
还没有评论,来抢沙发吧