// SCICRAFT — The Dark Photon Protocol // Protocol Tome: starter item that makes the FTB Quests guidance unmissable. // - Given to each player once on first login. // - Right-clicking it opens the FTB Quests book on the client. const TOME_SC = { item: 'scicraft:protocol_tome', channel: 'scicraft:open_quests', give_flag: 'scicraft_got_tome' } // Give the Tome once per player on first login. PlayerEvents.loggedIn(event => { const player = event.player if (player.persistentData.contains(TOME_SC.give_flag)) return player.persistentData.putBoolean(TOME_SC.give_flag, true) // Give on the next tick so the player is fully in-world first. event.server.scheduleInTicks(10, () => { if (!player.isOnline()) return player.give(Item.of(TOME_SC.item)) player.tell(Text.translate('scicraft.phrases.tome_given')) }) }) // Right-clicking the Tome asks the client to open the FTB Quests book. ItemEvents.rightClicked(event => { if (event.item.id !== TOME_SC.item) return if (event.player.crouching) return event.player.sendData(TOME_SC.channel, {}) event.cancel() })