Class SprayBottleItem
java.lang.Object
net.minecraft.item.Item
dev.jaxydog.astral.content.item.AstralItem
dev.jaxydog.astral.content.item.custom.SprayBottleItem
- All Implemented Interfaces:
Custom,Sprayed,LoreHolder,Registered,Registered.Client,Registered.Common,net.fabricmc.fabric.api.item.v1.FabricItem,net.minecraft.item.ItemConvertible,net.minecraft.resource.featuretoggle.ToggleableFeature
A spray bottle item containing water.
- Since:
- 1.6.0
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
net.minecraft.item.Item.SettingsNested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered
Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.ServerNested classes/interfaces inherited from interface dev.jaxydog.astral.content.item.custom.Sprayed
Sprayed.Behavior<T extends Sprayed.SprayTarget>, Sprayed.BlockTarget, Sprayed.EntityTarget, Sprayed.RefillContext, Sprayed.Source, Sprayed.SprayResult, Sprayed.SprayTarget -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SoundContextThe sound played when extinguishing a block.static final SoundContextThe sound played when extinguishing an entity.static final intThe maximum amount of sprays contained within the bottle.static final SoundContextThe sound played when wetting a sponge.Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, DEFAULT_MAX_COUNT, DEFAULT_MAX_USE_TIME, ITEM_BAR_STEPSFields inherited from interface dev.jaxydog.astral.content.item.custom.Sprayed
EMPTY_MODEL_ID, REFILL_SOUND, SPRAY_SOUNDFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
ConstructorsConstructorDescriptionSprayBottleItem(String path, net.minecraft.item.Item.Settings settings) Creates a new item using the given settings.SprayBottleItem(String path, net.minecraft.item.Item.Settings settings, @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup) Creates a new item using the given settings. -
Method Summary
Modifier and TypeMethodDescription<T extends Sprayed.SprayTarget>
voidaddBehavior(Class<T> type, Sprayed.Behavior<T> behavior) Adds a new behavior to this spray item.voidappendTooltip(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext context) <T extends Sprayed.SprayTarget>
List<Sprayed.Behavior<T>> getBehaviors(Class<T> type) Returns a list of behaviors for this spray item.voidonCraft(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity player) voidRegisters this value on both the client and server environments.net.minecraft.util.TypedActionResult<net.minecraft.item.ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand) net.minecraft.util.ActionResultuseOnBlock(net.minecraft.item.ItemUsageContext context) net.minecraft.util.ActionResultuseOnEntity(net.minecraft.item.ItemStack stack, net.minecraft.entity.player.PlayerEntity player, net.minecraft.entity.LivingEntity entity, net.minecraft.util.Hand hand) Methods inherited from class dev.jaxydog.astral.content.item.AstralItem
getItemGroup, getRegistryPathMethods inherited from class net.minecraft.item.Item
asItem, byRawId, canBeNested, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getFoodComponent, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getRegistryEntry, getRequiredFeatures, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isItemBarVisible, isNbtSynced, isNetworkSynced, isSuitableFor, isUsedOnRelease, onClicked, onItemEntityDestroyed, onStackClicked, onStoppedUsing, postHit, postMine, postProcessNbt, raycast, toString, usageTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.jaxydog.astral.content.item.Custom
getItemGroupMethods inherited from interface net.fabricmc.fabric.api.item.v1.FabricItem
allowContinuingBlockBreaking, allowNbtUpdateAnimation, getAttributeModifiers, getRecipeRemainder, isSuitableForMethods inherited from interface net.minecraft.item.ItemConvertible
asItemMethods inherited from interface dev.jaxydog.astral.content.item.LoreHolder
formatLoreText, getLoreTooltipsMethods inherited from interface dev.jaxydog.astral.register.Registered
getRegistryId, getRegistryPathMethods inherited from interface dev.jaxydog.astral.content.item.custom.Sprayed
canSpray, canSpray, getCharges, getCooldown, getDuration, getEmptyModelData, getMaxCharges, isEmpty, isFilled, isRefillable, isSprayable, isSprayable, onSpray, onSpray, refill, registerClient, setCharges, spray, spray, sprayMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
MAX_USES
public static final int MAX_USESThe maximum amount of sprays contained within the bottle.- Since:
- 1.6.0
- See Also:
-
EXTINGUISH_BLOCK_SOUND
The sound played when extinguishing a block.- Since:
- 2.0.0
-
EXTINGUISH_ENTITY_SOUND
The sound played when extinguishing an entity.- Since:
- 2.0.0
-
SPONGE_SQUISH_SOUND
The sound played when wetting a sponge.- Since:
- 2.0.0
-
-
Constructor Details
-
SprayBottleItem
public SprayBottleItem(String path, net.minecraft.item.Item.Settings settings, @Nullable @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup) Creates a new item using the given settings.If the
#preferredGroupsupplier isnull, this item will not be added to any item groups.- Parameters:
path- The item's identifier path.settings- The item's settings.preferredGroup- The item's preferred item group.- Since:
- 2.0.0
-
SprayBottleItem
Creates a new item using the given settings.This item will be added to the default item group.
- Parameters:
path- The item's identifier path.settings- The item's settings.- Since:
- 1.6.0
-
-
Method Details
-
addBehavior
public <T extends Sprayed.SprayTarget> void addBehavior(Class<T> type, Sprayed.Behavior<T> behavior) Description copied from interface:SprayedAdds a new behavior to this spray item.- Specified by:
addBehaviorin interfaceSprayed- Type Parameters:
T- The behavior's target type.- Parameters:
type- The class of the behavior's target type.behavior- The entity behavior.
-
getBehaviors
Description copied from interface:SprayedReturns a list of behaviors for this spray item.- Specified by:
getBehaviorsin interfaceSprayed- Type Parameters:
T- The behavior's expected target type.- Parameters:
type- The class of the behavior's expected target type.- Returns:
- A list of behaviors.
-
appendTooltip
public void appendTooltip(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext context) - Overrides:
appendTooltipin classAstralItem
-
use
public net.minecraft.util.TypedActionResult<net.minecraft.item.ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand) - Overrides:
usein classnet.minecraft.item.Item
-
useOnEntity
public net.minecraft.util.ActionResult useOnEntity(net.minecraft.item.ItemStack stack, net.minecraft.entity.player.PlayerEntity player, net.minecraft.entity.LivingEntity entity, net.minecraft.util.Hand hand) - Overrides:
useOnEntityin classnet.minecraft.item.Item
-
useOnBlock
public net.minecraft.util.ActionResult useOnBlock(net.minecraft.item.ItemUsageContext context) - Overrides:
useOnBlockin classnet.minecraft.item.Item
-
onCraft
public void onCraft(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity player) - Overrides:
onCraftin classnet.minecraft.item.Item
-
registerCommon
public void registerCommon()Description copied from interface:Registered.CommonRegisters this value on both the client and server environments.The contained code will run for both environments. If you only want one or the other, see its sister interfaces.
- Specified by:
registerCommonin interfaceCustom- Specified by:
registerCommonin interfaceRegistered.Common- See Also:
-