FalconFalcon
Docs menuCustom content

Plugins

Custom content

Register content in onLoad, through content(). Each call returns false when it fails. Put the matching textures in a resource_pack/ folder next to plugin.json.

Items

CustomItem fieldDefault
identifier, displayName, icon, creativeCategoryEmpty
maxStackSize64
maxDurability0
handEquippedfalse
onUse(Player &, Item &)Optional
onUseOnBlock(Player &, Item &, const BlockPos &, uint32_t face)Optional
falcon::CustomItem wand;
wand.identifier = "hello:thunder_wand";
wand.displayName = "Thunder Wand";
wand.icon = "thunder_wand";
wand.creativeCategory = "equipment";
wand.maxStackSize = 1;
wand.handEquipped = true;
wand.onUseOnBlock = [](falcon::Player &player, falcon::Item &, const falcon::BlockPos &position, uint32_t) {
    player.entity().level().strikeLightning(position.center());
    return true;
};

if (!content().item(std::move(wand)))
    logger().warning("Could not register the thunder wand");

Blocks

CustomBlock fieldDefault
identifier, displayName, texture, creativeCategory, dropEmpty
destroyTime1.0
explosionResistance1.0
lightEmission0
friction0.6
onInteract(Player &, const BlockPos &, uint32_t face)Optional, returns bool
onBreak(Player &, const BlockPos &)Optional

Entities

CustomEntity fieldDefault
identifierEmpty
width, height0.6, 1.8
maxHealth20
summonabletrue
onTick(Entity &)Optional
onInteract(Entity &, Player &)Optional, returns bool

Deeper changes

To subclass Block, Item, MobActor or Goal, use an internal plugin. For content defined in JSON, see Behavior packs.