FTB XMod Compat
FTB Quests, Teams and Chunks support.
#FTBQuestsEvents
#Completed
FTBQuestsEvents.completed('quest_id', event => {
event.player.tell('You completed the quest!')
})
Executes code when a specific quest is completed.
#CustomFilterItem
FTBQuestsEvents.customFilterItem(event => {
event.addStack('acacia_boat')
})
Adds ItemStack(s) to a custom Filter.
#CustomReward
FTBQuestsEvents.customReward('custom_reward_id', event => {
event.player.give('acacia_boat')
})
Adds logic to Custom Rewards.
#CustomTask
FTBQuestsEvents.customTask('custom_task_id', event => {
event.maxProgress = 100 // Sets the Progress Count.
event.setCheckTimer(20) // Checks for progress every 1 second (20 ticks).
event.setCheck((task, player) => {
if(player.level.thundering) { //Checks if it is Thundering at a player.
task.progress++ // Adds progress to the quest.
}
})
})
Adds logic to Custom Tasks. This example code progresses the quest every 20 seconds when Player is in a thunderstorm.
#Started
FTBQuestsEvents.started('quest_id', event => {
event.server.tell('A player started a quest!')
})
Executes code when a player starts a quest.
quest_id
= Quest's ID. To get it, right-click a Quest and select "Copy ID".custom_task_id
= "Custom" task's ID. To get it, right-click a Custom task and select "Copy ID".custom_reward_id
= "Custom" reward's ID. To get it, right-click a Custom reward and select "Copy ID".#FTBTeamsEvents
FTBTeamsEvents.playerJoinedParty(event => {
let team = event.currentTeam.name
let player = event.player.username
event.server.tell(
Component.aqua(player)
.append(' joined: ')
.append(Component.green(team))
)
})
playerJoinedParty
/ playerLeftParty
executes code when a player Joins or Leaves a party.This example here sends a message to everyone, saying who joined or left what party.
#FTBChunksEvents
#After
FTBChunksEvents.after("claim", (event) => {
let chunkPos = event.chunk.pos.chunkPos;
let player = event.player.username;
event.server.tell(
Component.aqua(player)
.append(Component.literal(" has claimed Chunk at: "))
.append(Component.green(chunkPos))
)
})
.after
executes code after a Chunk has been claimed.This example sends a message to everyone, saying who claimed a chunk, and the claimed chunks's position.
.after('string')
The string here is for which event to listen for. Current available operations:'claim'
'unclaim'
'load'
'unload'
#Before
.before
is currently broken! If it is applied, you will not be able to claim Chunks anymoreIt works just like
.after
, but before the specified operation.