52class ComponentItem :
public ::Item {
56 bool mExcludeUserDataDiffCheck : 1;
57 bool mCanDestroyInCreative : 1;
58 bool mRequiresInteract : 1;
59 bool mIsLiquidClipped : 1;
60 ::ll::TypedStorage<4, 4, float> mSpeed;
61 ::ll::TypedStorage<4, 4, int> mDamage;
62 ::ll::TypedStorage<4, 4, ::SharedTypes::EnchantSlot> mEnchantSlot;
63 ::ll::TypedStorage<4, 4, int> mEnchantValue;
64 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mAlias;
65 ::ll::TypedStorage<1, 1, bool> mIsAttachable;
66 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::std::shared_ptr<::ItemComponent>>> mItemComponents;
67 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::IconItemComponent>> mIcon;
68 ::ll::TypedStorage<8, 8, ::BlockType const*> mBlockTypeForRendering;
69 ::ll::TypedStorage<8, 16, ::std::map<::std::string, ::std::shared_ptr<::ItemComponent>>>
70 mRegisteredCerealComponents;
71 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx const>> mCtx;
81 virtual ~ComponentItem() ;
83 virtual void initServer(
87 ::std::optional<::LegacyEventItemComponentData> legacyEventData
90 virtual void tearDown() ;
92 virtual bool isComponentBased()
const ;
94 virtual bool isHumanoidArmor()
const ;
96 virtual bool isBlockPlanterItem()
const ;
98 virtual bool isDamageable()
const ;
100 virtual bool isDyeable()
const ;
102 virtual bool isFood()
const ;
104 virtual bool isThrowable()
const ;
106 virtual bool isUseable()
const ;
108 virtual bool isMusicDisk()
const ;
110 virtual bool isTrimAllowed()
const ;
112 virtual ::BlockType
const* getBlockTypeForRendering()
const ;
114 virtual ::ItemComponent* getComponent(
::HashedString const&
id)
const ;
116 virtual ::IFoodItemComponent* getFood()
const ;
118 virtual ::Item& setMaxDamage(
int maxDamage) ;
120 virtual ::std::string
const& getDescriptionId()
const ;
122 virtual ::BlockShape getBlockShape()
const ;
124 virtual bool canBeDepleted()
const ;
126 virtual bool canDestroySpecial(
::Block const& block)
const ;
128 virtual int getLevelDataForAuxValue(
int)
const ;
130 virtual short getMaxDamage()
const ;
132 virtual int getAttackDamage()
const ;
136 virtual bool canDestroyInCreative()
const ;
138 virtual bool isDestructive(
int)
const ;
140 virtual bool isLiquidClipItem()
const ;
142 virtual bool requiresInteract()
const ;
144 virtual void appendFormattedHovertext(
148 bool const showCategory
155 virtual int getEnchantSlot()
const ;
157 virtual int getEnchantValue()
const ;
159 virtual int getArmorValue()
const ;
161 virtual int getDamageChance(
int unbreaking)
const ;
163 virtual uint getSwingDuration()
const ;
165 virtual bool shouldEmitInUseGameEvents()
const ;
175 virtual ::std::optional<::SoundEventIdentifier> getAttackMissSound()
const ;
177 virtual ::std::optional<::SoundEventIdentifier> getAttackHitSound()
const ;
179 virtual ::std::optional<::SoundEventIdentifier> getAttackCriticalHitSound()
const ;
181 virtual ::SharedTypes::Legacy::LevelSoundEvent getEquipSound()
const ;
185 virtual bool canUseAsAttack()
const ;
191 virtual ::Actor* createProjectileActor(
195 ::Vec3 const& aimDirection
215 virtual ::std::string
218 virtual ::std::string buildEffectDescriptionName(
::ItemStackBase const& stack,
bool playerIsCreative)
const
223 virtual ::HashedString
const& getCooldownCategory()
const ;
225 virtual int getCooldownDuration()
const ;
227 virtual ::SharedTypes::ItemCooldownType getCooldownType()
const ;
229 virtual ::SharedTypes::Legacy::ActorLocation getEquipLocation()
const ;
231 virtual bool useVariant(
int,
int,
bool)
const;
233 virtual int getVariant(
int,
int,
bool)
const;
235 virtual ::Matrix getItemTransform(::ItemTransformType type,
float normalizedUnitScale)
const ;
237 virtual void initClient(
241 ::std::optional<::ItemIconInfo> (*)(::std::string
const&,
int)
244 virtual ::std::string getInteractText(
::Player const& player)
const ;
246 virtual int getAnimationFrameFor(
::Mob*,
bool,
::ItemStack const*,
bool)
const ;
248 virtual bool isEmissive(
int auxValue)
const ;
250 virtual ::ResolvedItemIconInfo
251 getIconInfo(
::ItemStackBase const& item,
int newAnimationFrame,
bool inInventoryPane)
const ;
253 virtual ::Item& setIconInfo(::std::string
const& name,
int frame) ;
255 virtual bool canBeCharged()
const ;
257 virtual ::ComponentItem& setDescriptionId(::std::string
const& descriptionId) ;
259 virtual bool shouldUseJsonForRenderMatrix()
const;
261 virtual ::std::unique_ptr<::CompoundTag> buildNetworkTag()
const ;
263 virtual void initializeFromNetwork(
::CompoundTag const& tag) ;
265 virtual ::std::vector<::std::string> validateFromNetwork(
::CompoundTag const& tag) ;
275 virtual bool _shouldAutoCalculatePlacePos()
const ;
277 virtual ::InteractionResult _useOn(
293 ::std::optional<::SemVersion> documentVersion,
294 ::std::optional<::Experiments> _experiments
304 ::std::optional<::LegacyEventItemComponentData> legacyEventData,
314 MCNAPI static ::std::tuple<
316 ::rapidjson::GenericDocument<
317 ::rapidjson::UTF8<char>,
318 ::rapidjson::MemoryPoolAllocator<::rapidjson::CrtAllocator>,
319 ::rapidjson::CrtAllocator>,
323 ::std::string_view document,
325 ::std::optional<::SemVersion> minVersion
344 MCAPI
void $initServer(
348 ::std::optional<::LegacyEventItemComponentData> legacyEventData
351 MCFOLD
void $tearDown();
353 MCFOLD
bool $isComponentBased()
const;
355 MCAPI
bool $isHumanoidArmor()
const;
357 MCAPI
bool $isBlockPlanterItem()
const;
359 MCAPI
bool $isDamageable()
const;
361 MCAPI
bool $isDyeable()
const;
363 MCFOLD
bool $isFood()
const;
365 MCAPI
bool $isThrowable()
const;
367 MCAPI
bool $isUseable()
const;
369 MCAPI
bool $isMusicDisk()
const;
371 MCAPI
bool $isTrimAllowed()
const;
373 MCAPI ::BlockType
const* $getBlockTypeForRendering()
const;
375 MCAPI ::ItemComponent* $getComponent(
::HashedString const&
id)
const;
377 MCAPI ::IFoodItemComponent* $getFood()
const;
379 MCAPI ::Item& $setMaxDamage(
int maxDamage);
381 MCAPI ::std::string
const& $getDescriptionId()
const;
383 MCFOLD ::BlockShape $getBlockShape()
const;
385 MCAPI
bool $canBeDepleted()
const;
387 MCAPI
bool $canDestroySpecial(
::Block const& block)
const;
389 MCFOLD
int $getLevelDataForAuxValue(
int)
const;
391 MCAPI
short $getMaxDamage()
const;
393 MCAPI
int $getAttackDamage()
const;
397 MCAPI
bool $canDestroyInCreative()
const;
399 MCFOLD
bool $isDestructive(
int)
const;
401 MCAPI
bool $isLiquidClipItem()
const;
403 MCAPI
bool $requiresInteract()
const;
405 MCAPI
void $appendFormattedHovertext(
409 bool const showCategory
415 MCAPI
int $getEnchantSlot()
const;
417 MCFOLD
int $getEnchantValue()
const;
419 MCAPI
int $getArmorValue()
const;
421 MCAPI
int $getDamageChance(
int unbreaking)
const;
423 MCAPI uint $getSwingDuration()
const;
425 MCAPI
bool $shouldEmitInUseGameEvents()
const;
435 MCAPI ::std::optional<::SoundEventIdentifier> $getAttackMissSound()
const;
437 MCAPI ::std::optional<::SoundEventIdentifier> $getAttackHitSound()
const;
439 MCAPI ::std::optional<::SoundEventIdentifier> $getAttackCriticalHitSound()
const;
441 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getEquipSound()
const;
445 MCAPI
bool $canUseAsAttack()
const;
450 MCAPI ::Actor* $createProjectileActor(
454 ::Vec3 const& aimDirection
474 MCAPI ::std::string $buildEffectDescriptionName(
::ItemStackBase const& stack,
bool playerIsCreative)
const;
478 MCAPI ::HashedString
const& $getCooldownCategory()
const;
480 MCAPI
int $getCooldownDuration()
const;
482 MCAPI ::SharedTypes::ItemCooldownType $getCooldownType()
const;
484 MCAPI ::SharedTypes::Legacy::ActorLocation $getEquipLocation()
const;
486 MCFOLD
bool $useVariant(
int,
int,
bool)
const;
488 MCFOLD
int $getVariant(
int,
int,
bool)
const;
490 MCAPI ::Matrix $getItemTransform(::ItemTransformType type,
float normalizedUnitScale)
const;
492 MCAPI
void $initClient(
496 ::std::optional<::ItemIconInfo> (*)(::std::string
const&,
int)
499 MCAPI ::std::string $getInteractText(
::Player const& player)
const;
501 MCFOLD
int $getAnimationFrameFor(
::Mob*,
bool,
::ItemStack const*,
bool)
const;
503 MCFOLD
bool $isEmissive(
int auxValue)
const;
505 MCAPI ::ResolvedItemIconInfo
506 $getIconInfo(
::ItemStackBase const& item,
int newAnimationFrame,
bool inInventoryPane)
const;
508 MCAPI ::Item& $setIconInfo(::std::string
const& name,
int frame);
510 MCAPI
bool $canBeCharged()
const;
512 MCAPI ::ComponentItem& $setDescriptionId(::std::string
const& descriptionId);
514 MCAPI
bool $shouldUseJsonForRenderMatrix()
const;
516 MCAPI ::std::unique_ptr<::CompoundTag> $buildNetworkTag()
const;
520 MCAPI ::std::vector<::std::string> $validateFromNetwork(
::CompoundTag const& tag);