MagicPaper icon

MagicPaper -----

Use magic to create your server



MagicPaper Semantics
Timer Control
Implementation
  • foliaTimer()
    • Create a folia timer
  • paperTimer()
    • Create a paper timer
  • addToTimer()
    • Add a magic task to the timer
Parameter Format
  • foliaTimer(timer name delay start interval data context)

  • paperTimer(timer name delay start interval data context)

  • addToTimer(timer name magic)
Return Value
  • null
Skills
Implementation
  • jumpSkill()
    • Jump in the direction you are facing
  • jumpToLocationSkill()
    • Jump in the direction of specified coordinates
Parameter Format
  • jumpSkill(player distance strength height strength)

  • jumpToLocationSkill(player target coordinates speed height strength)
Return Value
  • jumpSkill()
    • null
  • jumpToLocationSkill()
    • null
Cooldown
Implementation
  • addCoolDown()
    • Create a cooldown
  • checkCoolDown()
    • Check the cooldown
  • gocd()
    • Cooldown operation for magic
  • getcd()
    • Get cooldown time
Parameter Format
  • addCoolDown(id long(duration) cooldown reduction fixed cooldown reduction)

  • checkCoolDown(id)

  • gocd(cooldown ID duration cooldown message[optional])

  • getcd(cooldown ID)
Return Value
  • addCoolDown()
    • null
  • checkCoolDown()
    • bool
  • gocd()
    • null
  • getcd()
    • str
Common Objects
Implementation
  • player()
    • Player object
  • location()
    • Coordinate object
  • item()
    • Item object
  • citem()
    • Item clone
  • entity()
    • Entity
  • bossbar()
    • Boss bar
  • magicLocation()
    • Optimized coordinate object creation

    • All parameters must be strings, no conversion needed
Parameter Format
  • player()
    • player()
      • Default returns the magic executor with no parameters
    • player(player name string)
      • Get a player object based on the player name
    • player(object player type)
      • Restore object to player
    • player(coordinates radius quantity)
      • Get a specified number of players within a radius based on coordinates
  • location()
    • location()
      • Returns the executor's coordinates with no parameters
    • location(player)
      • Get player coordinates
    • location(object)
      • Restore object to location
    • location(x y z yaw pitch world)
      • Generate coordinates based on specific parameters
  • item()
    • item(player slot identifier)
      • mh
        • Main hand
      • oh
        • Offhand
      • h
        • Helmet
      • c
        • Chestplate
      • l
        • Leggings
      • s
        • Boots
    • item(player slot number)
  • cloneItem()
    • Same as item()
  • entity(player)

  • bossbar(key title color style)
  • magicLocation()
    • magicLocation(x y z world)

    • magicLocation(x y z world yaw pitch)
Return Value
  • player()
    • When searching for players by coordinates, the target found is a list of players

    • All others return a single player object
  • location()
    • Coordinate object
  • item()
    • The item itself
  • cloneItem()
    • Item clone
  • entity()
    • Entity
  • bossbar()
    • Boss bar
  • magicLocation()
    • Coordinate object
Behavior
Implementation
  • consoleCommand()
    • Execute a command in the console
  • playerCommand()
    • Execute a command as a player
  • playerAsyncTeleport()
    • Asynchronously teleport a player
  • playerTeleport()
    • Teleport a player
  • senderToAllPlayer()
    • Send a message to all online players
  • senderToPlayer()
    • Send a message to a specific player
  • updateInventory()
    • Refresh the inventory item information
  • actionMsg()
    • Send action bar message
  • playerCloseInv()
    • Close the player's inventory
  • potionAdd()
    • Add a potion effect
Parameter Format
  • consoleCommand(command string)

  • playerCommand(player command string)

  • playerAsyncTeleport(player coordinates)

  • playerTeleport(player coordinates)

  • senderToAllPlayer(content string)

  • senderToPlayer(player content string)

  • updateInventory(player)

  • actionMsg(player message)

  • playerCloseInv(player)

  • potionAdd(player potion type potion level duration)
Return Value
  • null
Buff
Implementation
  • buffAdd()
    • Add remaining time for a specific buff to a target
  • buffTimeGet()
    • Get the remaining time of a specific buff for a target
Parameter Format
  • buffAdd(target ID buff ID duration additional attributes string[optional] additional magic[optional]...)

  • buffTimeGet(target ID buff ID)
Return Value
  • buffAdd()
    • null
  • buffTimeGet()
    • A string representing a number
Gui
Implementation
  • guiOpen()
    • Open a GUI
  • guiPreviousPage()
    • Open the previous page of a GUI
  • guiNextPage()
    • Open the next page of a GUI
  • guiDataClear()
    • Clear GUI data
  • guiUpdate()
    • Update GUI data
Parameter Format
  • guiOpen(player Gui ID)

  • guiPreviousPage(player Gui ID)

  • guiNextPage(player Gui ID)

  • guiDataClear(player Gui ID)

  • guiUpdate(player Gui ID)
Return Value
  • guiOpen()
    • null
  • guiPreviousPage()
    • null
  • guiNextPage()
    • null
  • guiDataClear()
    • null
  • guiUpdate()
    • null
Button Data Source
  • Implementation
    • onlinePlayerButtons()
      • Map online players to button data source
  • Parameter Format
    • onlinePlayerButtons(item name string list)
      • ~ represents the player name variable, supports PAPI variables
  • Return Value
    • items
HOOK
LuckPerms
  • Implementation
    • playerLPMetaSet()
      • Set a player's Meta key-value
    • playerLPTempMetaSet()
      • Set a player's temporary Meta key-value
    • playerLPMetaGet()
      • Get the value of a key for a player
    • playerHasPermission()
      • Check if a player has a permission
  • Parameter Format
    • playerLPMetaSet(player key value)

    • playerLPTempMetaSet(player key value time (long))

    • playerLPMetaGet(player key)

    • playerHasPermission(player permission)
  • Return Value
    • playerLPMetaSet()
      • null
    • playerLPTempMetaSet()
      • null
    • playerLPMetaGet()
      • string
    • playerHasPermission()
      • bool
PlaceholderAPI
  • Implementation
    • placeholderAPI()
      • Resolve PAPI variables
    • papiStr()
      • Resolve the entire string
  • Parameter Format
    • placeholderAPI(variable)
      • No need to add %
    • papiStr(string)
  • Return Value
    • string
AbolethPlus
  • Implementation
    • aboAdd()
      • Use ABO to add data
    • aboGet()
      • Get ABO data
    • aboGetUser()
      • Use ABO to get a player's UUID
    • aboSet()
      • Set ABO data
    • aboEdit()
      • Edit data
    • aboSetTime()
      • Set variable duration
    • aboAddItem()
      • Use ABO to store items
    • aboGetItem()
      • Use ABO to get items
  • Parameter Format
    • aboAdd(uuid key value)

    • aboGet(uuid key)

    • aboGetUser(player name)

    • aboSet(uuid key value)

    • aboEdit(uuid key value action)
      • action
        • ABO native action, refer to the official documentation
    • aboSetTime(uuid key long (time))

    • aboAddItem(uuid key item)

    • aboGetItem(uuid key)
  • Return Value
    • aboAdd()
      • null
    • aboGet()
      • str
    • aboUserGet()
      • str
    • aboSet()
      • null
    • aboEdit()
      • null
    • aboSetTime()
      • null
    • aboAddItem()
      • null
    • aboGetItem()
      • item
MythicMobs
  • Implementation
    • castSkill()
      • Execute MM skills
    • spawnMob()
      • Spawn MM mobs
  • Parameter Format
    • castSkill(player skill name power factor)

    • spawnMob(mob name coordinates)
  • Return Value
    • castSkill()
      • null
    • spawnMob()
      • entity
ItemsAdder
  • Implementation
    • IAItem()
      • Get IA items
    • placeIABlock()
      • Place IA custom blocks
  • Parameter Format
    • IAItem(IA item ID)

    • placeIABlock(IA block ID coordinates)
  • Return Value
    • IAItem()
      • item
    • placeIABlock()
      • bool
Vault
  • Implementation
    • vaultGet()
      • Get balance
    • vaultGive()
      • Give balance
    • vaultHas()
      • Check if there is enough balance
    • vaultTake()
      • Deduct balance
  • Parameter Format
    • vaultGet(player)

    • vaultGive(player amount)

    • vaultHas(player amount)

    • vaultTake(player amount)
  • Return Value
    • vaultGet()
      • int
    • vaultGive()
      • null
    • vaultHas()
      • bool
    • vaultTake()
      • bool
PlayerPoints
  • Implementation
    • playerpointsGet()
      • Get balance
    • playerpointsGive()
      • Give balance
    • playerpointsHas()
      • Check if there is enough balance
    • playerpointsSet()
      • Set balance
    • playerpointsTake()
      • Deduct balance
  • Parameter Format
    • playerpointsGet(player)

    • playerpointsGive(player amount)

    • playerpointsHas(player amount)

    • playerpointsSet(player amount)

    • playerpointsTake(player amount)
  • Return Value
    • playerpointsGet()
      • double
    • playerpointsGive()
      • bool
    • playerpointsHas()
      • bool
    • playerpointsSet()
      • bool
    • playerpointsTake()
      • bool
Execution Control
Implementation
  • foliaSpellAsyncExecute()
    • Asynchronous execution under Folia
  • foliaSpellExecute()
    • Synchronous execution under Folia
  • paperSpellAsyncExecute()
    • Asynchronous execution under Paper
  • paperSpellExecute()
    • Synchronous execution under Paper
  • publicContextGet()
    • Get public data context
  • playerTraversal()
    • Traverse the list of players
Parameter Format
  • foliaSpellAsyncExecute(spell1 spell2...)

  • foliaSpellExecute(spell1 spell2...)

  • paperSpellAsyncExecute(spell1 spell2...)

  • paperSpellExecute(spell1 spell2...)

  • publicContextGet()

  • playerTraversal(players player i)
Return Value
  • null
Triggers
Implementation
  • addSpellToTrigger()
    • Add a spell task to a trigger
  • triggerClearSpell()
    • Clear tasks from a trigger
Parameter Format
  • addSpellToTrigger(trigger name spell)

  • triggerClearSpell(trigger name)
Return Value
  • null
Information
Implementation
  • playerName()
    • Get the player's name
  • paperConstants()
    • Extract configuration file constants
  • stringComparison()
    • String comparison
  • ignoreCaseStringComparison()
    • Case-insensitive string comparison
  • color()
    • Correct color codes
  • isTimeRange()
    • Determine if it's within a time range
  • inLocationRange()
    • Determine if coordinates are within a specified area
Parameter Format
  • playerName(player)

  • paperConstants(key)

  • stringComparison(string1 string2)

  • ignoreCaseStringComparison(string1 string2)

  • color(string)

  • isTimeRange(time range)
    • 8:30

    • 8:30-9:30
  • inLocationRange(target coordinates range coordinates1 range coordinates2)
Return Value
  • playerName()
    • str
  • paperConstants()
    • str
  • stringComparison()
    • bool
  • ignoreCaseStringComparison()
    • bool
  • color()
    • str
  • isTimeRange()
    • bool
  • inLocationRange()
    • bool
Item Operations
Implementation
  • itemGivePlayer()
    • Send an item to a player
  • itemSetPlayer()
    • Set an item in a player's specific slot
  • itemLoreAddLine()
    • Add a line to the lore of an item in a player's specific slot
  • itemLoreRemove()
    • Remove a specific NBT line from an item
  • itemToString()
    • Convert an item to a string
  • stringToItem()
    • Convert a string to an item
  • itemNBTAdd()
    • Add NBT to an item
  • itemNBTGet()
    • Get the NBT value of an item
  • itemNBTRemove()
    • Remove a specific NBT from an item
  • itemGetName()
    • Get the item's name
  • itemSetName()
    • Set the item's name
  • itemTypeGet()
    • Get the material name of the item
  • itemTypeSet()
    • Set the material name of the item
  • itemLoreHasLineNoColor()
    • Search for a specific line content in the lore, ignoring color
  • itemLoreHasLine()
    • Search for a specific line content in the lore
  • itemVarParse()
    • Parse item variables
  • itemLoreGet()
    • Get a specific lore line
  • newItem()
    • Create a new item
  • refreshVar()
    • Refresh lore display according to the template
  • itemModelGet()
    • Get the custom model value of the item
  • itemModelSet()
    • Set the custom model value of the item
  • itemEnchantmentGet()
    • Get the enchantment level of the item
  • itemEnchantmentSet()
    • Set the enchantment level of the item
  • itemDamageSet()
    • Set the item's durability loss value
  • itemDamageGet()
    • Get the item's durability loss value
  • itemAmountSet()
    • Set the item quantity
  • itemAmountGet()
    • Get the item quantity
  • itemAttributeSet()
    • Set the item's attributes
  • itemAttributeGet()
    • Get a specific attribute value of the item
  • itemFlag()
    • Change the display label
  • itemEnableRefresh()
    • Allow MagicPaper to automatically parse the lore of the item
  • itemFormatSet()
    • Set the parsing template for the current item
  • itemInfoSet()
    • Set the item description (NBT)
  • itemInfoAdd()
    • Add a line to the item description
  • itemBoreSet()
    • Set an embedding hole
  • itemSupportBoreAddressSet()
    • Allow a specific item to be embedded in a specific embedding hole
  • addItemToBore()
    • Attempt to embed an item into another item's embedding hole
  • removeItemFromBore()
    • Attempt to remove a specific embedded item from an item
  • itemAddSpell()
    • Add a Spell trigger to the item
  • mergeNBT()
    • Merge NBT
Parameter Format
  • itemGivePlayer(player item)

  • itemSetPlayer(player item slot)
    • Slot details can be found in the item method
  • itemLoreAddLine(item text)

  • itemToString(item)

  • stringToItem(string)

  • itemNBTAdd(item path key value)
    • Root directory is /

    • For example, if you want to store data in the TEST directory under the root then the path would be /TEST
  • itemNBTGet(item path key value type)
    • Type
      • STRING

      • ITEMSTACK

      • INT

      • LONG

      • FLOAT

      • DOUBLE

      • UUID

      • BOOLEAN
  • itemNBTRemove(item path key)

  • itemGetName(item)

  • itemSetName(item item name)

  • itemTypeGet(item)

  • itemTypeSet(item material name)

  • itemLoreRemove(item line number)

  • itemLoreHasLineNoColor(item line content)

  • itemLoreHasLine(item line content)

  • itemVarParse(item content)

  • itemLoreGet(item line number)

  • newItem(material)

  • refreshVar(item template ID)
    • Item display templates are in the plugin's configuration folder item-format
  • itemModelGet(item)

  • itemModelSet(item value)

  • itemEnchantmentGet(item enchantment name)
    • Enchantment name rules
      • Default is Minecraft vanilla enchantments

      • Use format belonging to the enchantment: enchantment name to specify enchantments provided by other modules

      • Vanilla enchantment list
  • itemEnchantmentSet(item enchantment name level)

  • itemDamageSet(item value)
    • Sets how much durability has been consumed from the item, not how much durability remains

    • Setting it to -1 makes the item indestructible
  • itemDamageGet(item)
    • Indestructible items return -1
  • itemAmountSet(item value)

  • itemAmountGet(item)

  • itemAttributeSet(item attribute ID attribute name value effect location calculation method)
  • Effective Locations
    • mh
      • Main Hand
    • oh
      • Offhand
    • h
      • Helmet
    • c
      • Chestplate
    • l
      • Leggings
    • s
      • Boots
  • Calculation Methods
    • +
      • Direct addition
    • +%
      • Addition as a percentage
    • +*
      • Addition using a coefficient
  • Attribute Names
  • itemAttributeGet(item attribute ID attribute name effective location calculation method)
  • itemFlag(item tag code)
    • Code Meanings
      • 1 - Hide Enchantments

      • 2 - Hide Custom Attributes

      • 3 - Hide Enchantments and Custom Attributes

      • 4 - Hide {Unbreakable} (Indestructible)

      • 8 - Hide {CanDestroy} (Can be Destroyed)

      • 16 - Hide {CanPlaceOn} (Can be Placed On)

      • 32 - Hide Most Information (Potion information, book author, fireworks effects, etc.)

      • 63 - Hide All Information except Name and Lore
  • itemEnableRefresh(item)

  • itemFormatSet(item template ID)

  • itemInfoSet(item description)
    • Separate multiple lines with \n
  • itemInfoAdd(item description)

  • itemBoreSet(item socket address max socket count socketed item attribute address socketing item attribute address)
    • Address format refers to NBT address format
  • itemSupportBoreAddressSet(item socket address)
    • After setting this, the item can be socketed into items with the corresponding socket address
  • addItemToBore(socketed item socketing item)
Item-Related Functions
Implementation
  • itemAddSpell(item triggerMethod SpellName long(cooldown))
    • Only for main-hand items

    • Trigger Methods
      • left

      • right

      • shiftLeft

      • shiftRight
  • removeItemFromBore(item slot index)
    • Index starts from 0
  • itemAddSpell(item spellName cooldown effectLocation triggerMethod)
    • Trigger Methods
      • left

      • right

      • shiftLeft

      • shiftRight
  • mergeNBT(item1 item2)
    • Merge the NBT of item2 into item1
Return Value
  • itemGivePlayer()
    • null
  • itemSetPlayer()
    • null
  • itemLoreAddLine()
    • item
  • itemToString()
    • string
  • stringToItem()
    • item
  • itemNBTAdd()
    • null
  • itemNBTGet()
    • object
  • itemNBTRemove()
    • null
  • itemGetName()
    • string
  • itemSetName()
    • null
  • itemTypeGet()
    • string
  • itemTypeSet()
    • null
  • itemLoreRemove()
    • null
  • itemLoreHasLineNoColor()
    • boolean
  • itemLoreHasLine()
    • boolean
  • itemVarParse()
    • string
  • newItem()
    • item
  • refreshVar()
    • item
  • itemModelGet()
    • int
  • itemModelSet()
    • null
  • itemEnchantmentGet()
    • int
  • itemEnchantmentSet()
    • null
  • itemDamageSet()
    • null
  • itemDamageGet()
    • int
  • itemAmountSet()
    • null
  • itemAmountGet()
    • int
  • itemAttributeSet()
    • null
  • itemAttributeGet()
    • double
  • itemFlag()
    • null
  • itemEnableRefresh()
    • null
  • itemFormatSet()
    • null
  • itemInfoSet
    • item
  • itemInfoAdd()
    • item
  • itemBoreSet()
    • item
  • itemSupportBoreAddressSet()
    • item
  • addItemToBore()
    • item
  • removeItemFromBore()
    • item

    • If successful, the context variable "removeItem" is obtained
  • itemAddSpell()
    • item
  • mergeNBT()
    • item
Yaml
Implementation
  • yamlManager()
    • Create a Yaml manager.
  • newYaml()
    • Create a new YAML file using the manager.
  • yamlGet()
    • Retrieve data from YAML.
  • yamlSet()
    • Store a value in YAML.
  • yamlSave()
    • Save a specific YAML file from the manager to the hard drive.
  • yamlSaveAll()
    • Save all YAML files in the manager.
  • hasyamlkey()
    • Check if a specific key exists.
  • hasyaml()
    • Check if a YAML file with a specific name exists.
Parameter Format
  • yamlManager(path, folderName)

  • newYaml(Yaml manager, fileId)

  • yamlGet(Yaml manager, fileId, key)

  • yamlSet(Yaml manager, fileId, key, value)

  • yamlSave(Yaml manager, fileId)

  • yamlSaveAll(Yaml manager)

  • hasyamlkey(Yaml manager, fileId, key)

  • hasyaml(Yaml manager, fileId)
Return Values
  • yamlManager()
    • Yaml manager
  • newYaml()
    • null
  • yamlGet()
    • object
  • yamlSet()
    • null
  • yamlSave()
    • null
  • yamlSaveAll()
    • null
  • hasyamlkey()
    • boolean
  • hasyaml()
    • boolean
Random
Implementation
  • randomDouble()
    • Generate a random decimal within a range.
  • weightRandom()
    • Select a string with specified weights randomly.
  • randomUUID()
    • Generate a random UUID.
Parameter Format
  • randomDouble(starting value, ending value, decimal places)

  • weightRandom(string1, string2, string3...)
    • String format
      • Content|Weight
        • ABC|10
  • randomUUID()
Return Values
  • randomDouble()
    • double
  • weightRandom
    • string
  • randomUUID()
    • string
Biology
Implementation
  • newEntity()
    • Create a new entity.
Parameter Format
  • newEntity(entity type, coordinates)
Return Values
  • newEntity()
    • entity
BOSS Health Bar
Implementation
  • showBossBar()
    • Show the boss health bar.
  • hideBossBar()
    • Hide the boss health bar.
  • bossbarVisible()
    • Set boss health bar visibility.
  • bossbarGet()
    • Get the boss health bar.
  • addFlag()
    • Add a boss health bar flag.
Parameter Format
  • showBossBar(Player bossbar)

  • hideBossBar(Player bossbar)

  • bossbarVisible(true/false)

  • bossbarGet(key)

  • addFlag(flag)
Return Values
  • showBossBar()
    • null
  • hideBossBar()
    • null
  • bossbarVisible()
    • null
  • bossbarGet()
    • bossbar
  • addFlag()
    • null
Resource Information
Author:
----------
Total Downloads: 982
First Release: Oct 15, 2023
Last Update: Nov 24, 2023
Category: ---------------
All-Time Rating:
0 ratings
Find more info at wiki.originmc.cn...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings