Addon Compatibility

What Addons are have

  • When this Add-On is on a world with PFE you can obtain stickers of every mob in PFE

Even if this Add-On is not installed you can still get them in creative

  • When this Add-On is on a world with PFE you can see stats on various things from PFE

Even if this Add-On is not installed these stats will be saved in scoreboard

  • When this Add-On is on a world with PFE you can put various items in the Accessories Menu's slots

  • Items with equip / set effects in these slots will also provide their effect contributions

  • When this Add-On is on a world with PFE:

    • The Listener will drop the PFE Listener Hoodie

    • You can craft the Poke's Fantasy Expansion Merch

What can be integrated into from PFE

  • scriptevent poke_pfe:enabled

    • This will send true (as a string) to the scriptevent id provided in the message

Example command: /scriptevent poke_pfe:enabled poke_pfe:receive_test

This would send true (as a string) to the script event id of poke_pfe:receive_test

Armor Effects

/*
Add-On Creators: You can add set effect presets into PFE's set effect system.

Note: the custom preset get re-initialized after the world loads. 
This is to ensure that players will not get set effects form Add-Ons that 
are no longer to the world. 

The soonest presets should be sent/added is a few seconds after the world loads
(This is to ensure it will not get caught in the re-initialization)

Presets can be added at anytime after the soonest possible & will still take effect


This is example code for adding 2 custom presets: 1 will check for item tags
while the other looks for a value within the item's lore
*/
import { world } from "@minecraft/server"
/*
Interface for effect options
effect: the effect identifer
maxAmp: this will decide what the highest effect amplifier/level this item can give (the highest max of equipped items will be used) 
*/
interface PFEEffectOptions {
  effect: MinecraftEffectTypes | string,
  max_amp: number
}
/*
Interface for adding custom set effect presets, 
Mode: (defaults to tag) lore will make `tag` check the lore of an item to see if it contains a certain value (it can be anywhere in it, just need to exist)
*/
interface PFECustomEffectInfo {
  mode?: "tag" | "lore"
  effects: PFEEffectArray[],
  tag: string,
}
/*
This is what you would send via script event
*/
interface PFEUnparsedCustomEffectInfo {
  value: PFECustomEffectInfo[]
}
world.afterEvents.worldInitialize.subscribe((data) => {
  const Presets: PFEUnparsedCustomEffectInfo = {
    value: [
      { mode: "tag", effects: [{ effect: "minecraft:night_vision", max_amp: 1 }], tag: "poke_pfe:night_vision" },
      { mode: "lore", effects: [{ effect: "minecraft:regeneration", max_amp: 3 }, { effect: "minecraft:fatal_poison", max_amp: 4 }], tag: "poke_pfe:custom_preset" }
    ]
  }
  world.getDimension(`minecraft:overworld`).runCommand(`scriptevent poke_pfe:add_set_effect_preset ${JSON.stringify(Presets)}`)
})

Quests:

/*
Add-On Creators: You can add quests into PFE's quest system.

Note: the custom quests get re-initialized after the world loads. 
This is to ensure that players will not get quests for Add-Ons that 
are no longer in the world. (Quests should be added a few seconds after the world loads)

Note x2: Quests that have been rolled not be able to be changed

This is example code. This will add a Mine quest for 7x Cut Cobalt for 7x Copper Tokens:
*/
import { ItemStack, world } from "@minecraft/server"
interface PFECustomQuests {
  value: [{
    requiredItem: {
      item: string,
      amount: number
      translationString: string
    },
    reward: {
      tokenAmount: number,
      item?: ItemStack tead (MAY NOT WORK IN CUSTOM QUESTS)
    }
  }]
}
interface PFEQuestInfo {
  requiredItem: {
    item: string, // the identifier of the required item
    amount: number // amount of the item the player needs in order to complete this quest
    translationString: string // this follows the same syntax as the minecraft:display_name component
  },
  reward: {
    tokenAmount: number, // number of Copper Tokens the player receives
    item?: ItemStack // optional: an itemStack that the player would receive ins
  }
}
interface PFECustomQuests {
    value: PFEQuestInfo[]
}
const PFECustomMineQuestsPropertyID = `poke_pfe:custom_mine_quests`
const PFECustomFarmQuestsPropertyID = `poke_pfe:custom_farm_quests`
const PFECustomCraftQuestsPropertyID = `poke_pfe:custom_craft_quests`
const PFECustomKillQuestsPropertyID = `poke_pfe:custom_kill_quests`

world.afterEvents.worldInitialize.subscribe((data) => {
  const AddedMineQuests:PFECustomQuests = {
    value: [
      { requiredItem: { item: `poke:cut_cobalt`, amount: 7, translationString: `%poke_pfe.cut_cobalt (%poke_pfe.tag)` }, reward: { tokenAmount: 7 } }
    ]
  }
  world.getDimension(`minecraft:overworld`).runCommand(`scriptevent poke_pfe:custom_mine_quests ${JSON.stringify(AddedMineQuests)}`)
})

How can you make your addon compatible with PFE?

  • The biggest thing is avoiding modifying vanilla files/features

    • some examples:

      • modifying the crafting table's UI (usually done to make custom crafting table UIs) can completely break the minecraft:crafting_table block component resulting in the Crafters (Spell crafter & Dye Un-mixer)

    • See Vanilla Files modified and make sure you are not modifying any of the same files

Last updated