Skip to content

ConjureSpell

MomoPewpew edited this page Apr 11, 2024 · 17 revisions

Source Code

spell-class: ".instant.ConjureSpell"

Description:

Spawns items in different ways.

Configuration:

Option Description Default Value
delay The delay between casting the spell and the item(s) being conjured. -1
pickup-delay If add-to-inventory is set to false, this will determine the pickup delay in server ticks. 0
required-slot Forces a conjured item to appear in this slot if "add-to-inventory" is set to true. Works even if other items are in the slot. -1
preferred-slot Forces a conjured item to appear in this slot, if "add-to-inventory" is set to true, and no other items are in the slot. -1
expiration Item expiration in miliseconds. 0
random-velocity If "add-to-inventory" is false and this is greater than 0, the item(s) will spawn with this velocity in a random direction. 0
offhand Whether or not the item should appear in the offhand slot if "add-to-inventory" is set to true. false
auto-equip Whether to attempt to automatically equip armor. This will not replace armor if the player is already wearing something. false
stack-existing If true, conjured item(s) will be placed into existing stacks of the item. true
gravity If "add-to-inventory" is false and this is set to false, the item(s) will be unaffected by gravity. true
add-to-inventory If this is true, conjured items will be added directly to the caster's inventory. If this is false, they will be dropped at the caster's feet. false
add-to-ender-chest Whether or not to add the conjured item(s) to the caster's ender chest. false
ignore-max-stack-size Whether the spell should ignore max stack size for the conjured item. false
power-affects-chance Whether the spell power affects the chance that items will drop. true
drop-if-inventory-full If add-to-inventory is true but the inventory is full, the item will be dropped at the player's feet if this is true. Otherwise, the item will not be conjured. true
power-affects-quantity Whether the spell power affects the number of items dropped. false
force-update-inventory Whether the spell should force an inventory update. true
calculate-drops-individually If this is true, each drop will be handled individually, meaning its random chance will be calculated separately, and it will be possible for everything to drop. If this is false, the drops will be handled together and it will assume that all of the changes add up to 100%, so only one of the items will drop. true
save-conjurer-name Whether the name of the conjurer should be stored in the conjured item's NBT tags. If the conjured item does not stack, then this is always true. false
items A list of item(s) that will be spawned. (See below for formatting information) null

Item Formatting:

Each item in the list follows this format:

itemtype quantitymin[-quantitymax] [chance%]

You can also conjure scrolls and tomes using this format:

SCROLL:scroll_spell_name:spell_name_to_put_on_scroll:uses

TOME:tome_spell_name:spell_name_to_put_on_tome:uses

A few examples:

331 5-7 = Five to seven redstone dust will drop

265 1-2 10% = There is a 10% chance for 1-2 iron bars to drop

351:4 1 10% = There is a 10% chance for 1 lapis to drop

SCROLL:scroll:blink:5 = A scroll with five charges of blink will drop

TOME:tome:leap:1 = A tome that teaches the leap spell will drop

Example:

conjure:
    spell-class: ".instant.ConjureSpell"
    name: conjure
    spell-icon: redstone
    description: Conjure some potion reagents.
    cast-item: book
    cooldown: 600
    power-affects-quantity: false
    power-affects-chance: true
    calculate-drops-individually: true
    auto-equip: false
    items:
        - redstone 1-2 25%
        - glistering_melon_slice 1 25%
        - magma_cream 1-2 25%
        - spider_eye 1-2 25%
    add-to-inventory: false
    str-cost: free
    str-cast-self: You have conjured some potion reagents!
Clone this wiki locally