Compatibility
Minecraft: Java Edition
1.21.1
Platforms
Supported environments
Links
Creators
Details
Licensed LGPL-3.0-only
Published 2 weeks ago
Updated 4 days ago
필수 모드(Dependencies)
https://modrinth.com/mod/pyke-lib
주의사항
로컬서버를 8080 포트를 이용해서 열기 때문에 다른 프로그램에서 8080 포트를 사용 중이면 문제가 발생할 수 있습니다.
명령어
/후원연동 <숲/치지직> | 플랫폼 로그인 창이 뜨며 약관 동의 시 연결이 됩니다. (방송 화면에 주소 노출 금지)
/연동해제 | 연결된 후원 연동을 해제합니다. /후원연동 입력시 재연결됩니다.
* 관리자 전용 -
/후원 <player> <숲/치지직> <amount>
kubejs 사용 방법
const BridgeAPI = Java.loadClass("kr.pyke.integration.BridgeIntegration");
const PykeLib = Java.loadClass("kr.pyke.PykeLib");
const COLOR = Java.loadClass("kr.pyke.util.constants.COLOR");
const ArrayList = Java.loadClass("java.util.ArrayList");
BridgeAPI.DONATION_HANDLER = (player, event) => {
let server = player.server;
server.executeIfPossible(() => {
const name = player.displayName.getString(); // 받는 사람
const sender = event.donor(); // 보낸사람
const rawAmount = event.getAmount(); // 받은 개수 (치즈 수 or 별풍선 수)
const type = event.donationMessage(); // 후원 메시지
const platform = event.platform().toString(); // 플랫폼 (CHZZK, SOOP)
const formattedAmount = rawAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
let krwValue = rawAmount; // 로직 계산용 원화 가치
let notificationMsg = ""; // 채팅창 출력 메시지
// [메시지 설정]
if (platform === "SOOP") {
krwValue = rawAmount * 100;
notificationMsg = `§7${name}§f님이 §e별풍선 ${formattedAmount}개§f를 후원 받으셨습니다.`;
}
else {
notificationMsg = `§7${name}§f님이 §e${formattedAmount} 치즈§f를 후원 받으셨습니다.`;
}
sendLibMessage(player, COLOR.LIME.getColor(), notificationMsg);
// [조건부 보상 예시 1] 500,000원 상당 후원 시
if (krwValue === 500000) {
let cmd = `tell ${name} 50만원 후원 받음 lol`;
player.server.runCommand(cmd);
}
// [조건부 보상 예시 2] 1,000원 상당 후원 시 다이아몬드 지급
if (krwValue === 1000) {
player.give('minecraft:diamond');
player.tell(`1천원 받아서 다이아몬드 받음`);
}
});
};
function sendLibMessage(player, color, message) {
if (!player) { return; }
let nativePlayer;
if (player.minecraftPlayer) { nativePlayer = player.minecraftPlayer; }
else { nativePlayer = player; }
try {
let playerList = new ArrayList();
playerList.add(nativePlayer);
PykeLib.sendSystemMessage(playerList, color, message);
}
catch (e) { console.error("메시지 전송 실패: " + e); }
}
Config
{
"chzzk": {
"clientID": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET"
},
"soop": {
"clientID": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET"
}
}
API 애플리케이션 등록 방법
https://developers.chzzk.naver.com/
https://developers.sooplive.co.kr/

Required Modes (Dependencies)
https://modrinth.com/mod/pyke-lib
Precautions
Since the local server uses port 8080, issues may arise if another program is already using port 8080.
Commands
/후원연동 <SOOP/CHZZK> | Displays the login window; connection is established upon agreeing to the terms. (Do not expose the address on the broadcast screen)
/연동해제 | Disconnects the current connection. Re-entering /후원연동 will reconnect.
- Administrator Only -
/후원 <player> <SOOP/CHZZK> <amount>
How to Use kubejs
const BridgeAPI = Java.loadClass("kr.pyke.integration.BridgeIntegration");
const PykeLib = Java.loadClass("kr.pyke.PykeLib");
const COLOR = Java.loadClass("kr.pyke.util.constants.COLOR");
const ArrayList = Java.loadClass("java.util.ArrayList");
BridgeAPI.DONATION_HANDLER = (player, event) => {
let server = player.server;
server.executeIfPossible(() => {
const name = player.displayName.getString(); // Recipient
const sender = event.donor(); // Donor nickname
const rawAmount = event.getAmount(); // Amount (Cheese or Balloons)
const type = event.donationMessage(); // Donation type
const platform = event.platform().toString(); // Platform (CHZZK, SOOP)
const formattedAmount = rawAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
let krwValue = rawAmount;
if (platform === "SOOP") {
krwValue = rawAmount * 100;
}
// Message logic
let notificationMsg = "";
if (platform === "SOOP") {
notificationMsg = `§7${name}§f has received a donation of §e${formattedAmount}§f balloons on SOOP.`;
} else {
notificationMsg = `§7${name}§f has received a donation of §e${formattedAmount}§f cheese on CHZZK.`;
}
sendLibMessage(player, COLOR.LIME.getColor(), notificationMsg);
// [Conditional Reward Example] When receiving 1,000 KRW value, give a diamond
if (krwValue === 1000) {
player.give('minecraft:diamond');
player.tell(`Received 1,000 KRW value, so you get a diamond`);
}
});
};
function sendLibMessage(player, color, message) {
if (!player) { return; }
let nativePlayer;
if (player.minecraftPlayer) { nativePlayer = player.minecraftPlayer; }
else { nativePlayer = player; }
try {
let playerList = new ArrayList();
playerList.add(nativePlayer);
PykeLib.sendSystemMessage(playerList, color, message);
}
catch (e) { console.error("Message send failed: " + e); }
}
Config
{
"chzzk": {
"clientID": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET"
},
"soop": {
"clientID": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET"
}
}
How to Register a Cheese Bridge API Application
https://developers.chzzk.naver.com/
https://developers.sooplive.co.kr/




