Skip to main content
Version: 2.x

Players & world

Player capabilities

Attached to every player (VampirismAttachments). Fetch with the VampirismApi helpers:

IVampirePlayer vampire = VampirismApi.vampirePlayer(player);
IHunterPlayer hunter = VampirismApi.hunterPlayer(player);

IVampirePlayer

Extends FactionApi's IFactionPlayer<IVampirePlayer> and ISkillPlayer<IVampirePlayer> (faction membership, level, lord level, skills, actions – see FactionApi), plus IVampire, IBiteableEntity and IVampireVisionUser. Vampirism-specific parts:

  • BloodgetBloodStats() returns IBloodStats; drinkBlood(amount, saturation, useRemaining, IDrinkBloodContext) (from IVampire).
  • Vision – activate / cycle IVampireVisions (via IVampireVisionUser).
  • Sun & fire – increased fire damage handling, sun-damage checks.
  • DBNO – "down but not out" death-prevention state.

IHunterPlayer

Extends IFactionPlayer<IHunterPlayer>, ISkillPlayer<IHunterPlayer> and IHunter. Notable: breakDisguise() – call whenever the player does something that would blow their hunter disguise.

Faction extensions

Lord-level sub-roles are FactionApi faction extensions: IDraculaPlayer (vampire) and IMarshallPlayer (hunter), resolved with handler.getExtension(IDraculaPlayer.class) etc.

IBloodStats

Blood bar, analogous to vanilla FoodStats; implements NeoForge's ResourceHandler<FluidResource> so blood can be moved in/out like a fluid tank. VReference.FOOD_TO_FLUID_BLOOD (100) is the conversion factor between nutrition and blood mB.

Creature capability

VampirismApi.extendedCreatureVampirism(mob)IExtendedCreatureVampirism (on every PathfinderMob): current/max blood, poisonous-blood duration, and convertToVampire() / per-tick hooks. It also implements IBiteableEntity.

World handlers

AccessorInterfacePurpose
VampirismApi.garlicHandler(level)IGarlicChunkHandlerPer-chunk garlic-diffuser strength (EnumStrength).
VampirismApi.fogHandler(level)IFogHandlerVampire fog areas.

Services

VampirismApi.services()IVampirismServices:

MethodInterfacePurpose
sunDamageRegistry()ISundamageRegistryQuery / register sun-damage exemptions (also from data packs).
entityRegistry()IVampirismEntityRegistryEntity blood values + converting; convert(mob), getBlood(mob), auto-calculation.
bloodConversionRegistry()IBloodConversionRegistryItem→impure-blood and fluid→blood conversion (see Blood Values).
extendedBrewingRecipeRegistry()IExtendedBrewingRecipeRegistryRegister ExtendedPotionMix entries – see Items.

Entity interfaces

de.teamlapen.vampirism.api.world.entity provides marker/behaviour interfaces implemented by Vampirism entities and useful for instanceof checks or addon entities:

  • Vampires – IVampire, IVampireMob, IBasicVampire, IAdvancedVampire, IVampireBaron.
  • Hunters – IHunter, IHunterMob, IBasicHunter, IAdvancedHunter, IVampirismCrossbowUser.
  • Converted – IConvertedCreature, ICurableConvertedCreature, IConvertingHandler.
  • Other – IBiteableEntity, IAdjustableLevel (used by the vampirism:adjustable_level loot condition), IAggressiveVillager, Difficulty.