Interface SulfurCube
- All Superinterfaces:
AbstractCubeMob, Ageable, Attributable, Audience, Bucketable, CommandSender, Creature, Damageable, DataComponentView, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, Leashable, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ProjectileSource, ServerOperator, Shearable, Sound.Emitter, Sound.Source.Provider
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents the archetype of a sulfur cube which define a lot of possible behavior and interaction throughout its lifetime.Nested classes/interfaces inherited from interface Entity
Entity.Spigot -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this sulfur cube is capable of exploding.default ItemStackRetrieves the item stack currently swallowed by this sulfur cube.intGets the amount of ticks until this sulfur cube explode.default booleanignite()Ignites this sulfur cube, beginning its fuse ifcanExplode()istrue.booleanignite(boolean imminent) Ignites this sulfur cube, beginning its fuse ifcanExplode()istrue.default voidsetEquipped(ItemStack itemStack) Sets the swallowed item stack for this sulfur cube.voidsetFuseTicks(int ticks) Sets the amount of ticks until this sulfur cube explode.booleanMakes this sulfur cube swallow the provided item, following any Vanilla logic.Methods inherited from interface AbstractCubeMob
canWander, getSize, setSize, setWanderMethods inherited from interface Ageable
canBreed, getAge, getAgeLock, isAdult, setAdult, setAge, setAgeLock, setBaby, setBreedMethods inherited from interface Attributable
getAttribute, registerAttributeMethods inherited from interface Audience
clearResourcePacks, clearTitle, closeDialog, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showDialog, showTitle, stopSound, stopSoundMethods inherited from interface Bucketable
getBaseBucketItem, getPickupSound, isFromBucket, setFromBucketMethods inherited from interface CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessageMethods inherited from interface Damageable
damage, damage, damage, getAbsorptionAmount, getHealth, getMaxHealth, heal, heal, kill, kill, resetMaxHealth, setAbsorptionAmount, setHealth, setMaxHealthMethods inherited from interface DataComponentView
getData, getDataOrDefault, hasDataMethods inherited from interface Entity
addPassenger, addScoreboardTag, asHoverEvent, broadcastHurtAnimation, collidesAt, copy, copy, createSnapshot, eject, fromMobSpawner, getAsString, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPickItemStack, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getRemovalReason, getRemoveEventCause, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSoundCategory, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getVisualFire, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, hasNoPhysics, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvisible, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isInWorld, isOnGround, isPersistent, isSilent, isSneaking, isTicking, isTrackedBy, isUnderWater, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, lookAt, lookAt, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvisible, setInvulnerable, setLastDamageCause, setNoPhysics, setPassenger, setPersistent, setPortalCooldown, setPose, setPose, setRotation, setRotation, setSilent, setSneaking, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, teleportAsync, teleportAsync, wouldCollideUsingMethods inherited from interface Frictional
getFrictionState, setFrictionStateMethods inherited from interface HoverEventSource
asHoverEventMethods inherited from interface Leashable
getLeashHolder, isLeashed, setLeashHolderMethods inherited from interface LivingEntity
addPotionEffect, addPotionEffect, addPotionEffects, attack, broadcastSlotBreak, broadcastSlotBreak, canBreatheUnderwater, canUseEquipmentSlot, clearActiveItem, clearActivePotionEffects, completeUsingActiveItem, damageItemStack, damageItemStack, getActiveItem, getActiveItemHand, getActiveItemRemainingTime, getActiveItemUsedTime, getActivePotionEffects, getArrowCooldown, getArrowsInBody, getArrowsStuck, getBeeStingerCooldown, getBeeStingersInBody, getBodyYaw, getCanPickupItems, getCategory, getCollidableExemptions, getCombatTracker, getDeathSound, getDrinkingSound, getEatingSound, getEyeHeight, getEyeHeight, getEyeLocation, getFallDamageSound, getFallDamageSoundBig, getFallDamageSoundSmall, getForwardsMovement, getHandRaised, getHandRaisedTime, getHurtDirection, getHurtSound, getHurtSound, getItemInUse, getItemInUseTicks, getItemUseRemainingTime, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getMemory, getNextArrowRemoval, getNextBeeStingerRemoval, getNoActionTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getShieldBlockingDelay, getSidewaysMovement, getSoundPitch, getSoundVolume, getTargetBlock, getTargetBlock, getTargetBlock, getTargetBlockExact, getTargetBlockExact, getTargetBlockFace, getTargetBlockFace, getTargetBlockFace, getTargetBlockInfo, getTargetBlockInfo, getTargetEntity, getTargetEntity, getTargetEntityInfo, getTargetEntityInfo, getUpwardsMovement, getWaypointColor, getWaypointStyle, hasActiveItem, hasAI, hasLineOfSight, hasLineOfSight, hasPotionEffect, isClimbing, isCollidable, isGliding, isHandRaised, isJumping, isLeashed, isRiptiding, isSleeping, isSwimming, knockback, playHurtAnimation, playPickupItemAnimation, playPickupItemAnimation, rayTraceBlocks, rayTraceBlocks, rayTraceEntities, rayTraceEntities, removePotionEffect, setActiveItemRemainingTime, setAI, setArrowCooldown, setArrowsInBody, setArrowsInBody, setArrowsStuck, setBeeStingerCooldown, setBeeStingersInBody, setBodyYaw, setCanPickupItems, setCollidable, setGliding, setHurtDirection, setItemInUseTicks, setJumping, setKiller, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setMemory, setNextArrowRemoval, setNextBeeStingerRemoval, setNoActionTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, setRiptiding, setShieldBlockingDelay, setSwimming, setWaypointColor, setWaypointStyle, startUsingItem, swingHand, swingMainHand, swingOffHandMethods inherited from interface Lootable
clearLootTable, getLootTable, getSeed, hasLootTable, setLootTable, setSeedMethods inherited from interface Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface Mob
getAmbientSound, getDespawnInPeacefulOverride, getEquipment, getHeadRotationSpeed, getMaxHeadPitch, getPathfinder, getPossibleExperienceReward, getTarget, isAggressive, isAware, isInDaylight, isLeftHanded, lookAt, lookAt, lookAt, lookAt, lookAt, lookAt, setAggressive, setAware, setDespawnInPeacefulOverride, setLeftHanded, setLootTable, setTarget, shouldDespawnInPeacefulMethods inherited from interface Nameable
customName, customName, getCustomName, setCustomNameMethods inherited from interface Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachmentMethods inherited from interface PersistentDataHolder
getPersistentDataContainerMethods inherited from interface Pointered
get, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface ProjectileSource
launchProjectile, launchProjectile, launchProjectileMethods inherited from interface ServerOperator
isOp, setOpMethods inherited from interface Shearable
readyToBeSheared, shear, shearMethods inherited from interface Sound.Source.Provider
soundSource
-
Method Details
-
getFuseTicks
int getFuseTicks()Gets the amount of ticks until this sulfur cube explode.- Returns:
- the fuse ticks or -1 if not exploding
-
setFuseTicks
void setFuseTicks(int ticks) Sets the amount of ticks until this sulfur cube explode.- Parameters:
ticks- the new fuse ticks
-
canExplode
boolean canExplode()Determines whether this sulfur cube is capable of exploding.- Returns:
trueif the sulfur cube can explode,falseotherwise
-
ignite
boolean ignite(boolean imminent) Ignites this sulfur cube, beginning its fuse ifcanExplode()istrue.The amount of time the sulfur cube takes to explode is defined in the
SulfurCube.Archetypeof the entity and further controlled by theimminentparameter.This action can be cancelled using
EntityIgniteEvent. The resulting explosion can also be cancelled by anExplosionPrimeEventand obeys the mob griefing gamerule.- Parameters:
imminent- iftruethe fuse time is shortened but still depends on theSulfurCube.Archetype- Returns:
- whether the sulfur cube got ignited
- See Also:
-
ignite
default boolean ignite()Ignites this sulfur cube, beginning its fuse ifcanExplode()istrue.The amount of time the sulfur cube takes to explode is defined in the
SulfurCube.Archetypeof the entity.This action can be cancelled using
EntityIgniteEvent. The resulting explosion can also be cancelled by anExplosionPrimeEventand obeys the mob griefing gamerule.- Returns:
- whether the sulfur cube got ignited
- See Also:
-
swallow
Makes this sulfur cube swallow the provided item, following any Vanilla logic.This method will:
- not equip the item to a baby sulfur cube,
- if present, drop a previously swallowed item, and
- play the swallow sound.
If the currently swallowed item is changed, a
EntityEquipmentChangedEventis called. May also call aEntityAddToWorldEventfor the newly droppedItementity.- Parameters:
itemStack- the item to swallow. UseItemStack.empty()to unset the item. Items not in theItemTypeTagKeys.SULFUR_CUBE_SWALLOWABLEtag will not be properly rendered inside the sulfur cube- Returns:
- whether the sulfur cube's absorbed item was updated
- See Also:
-
setEquipped
Sets the swallowed item stack for this sulfur cube.This method acts as a simple utility method to set the
EquipmentSlot.BODYequipment slot of this sulfur cube, which holds the sulfur cube's swallowed item.Different to
swallow(ItemStack), this method does not play a sound or drop the previously equipped item on the ground.This method will call a
EntityEquipmentChangedEvent.- Parameters:
itemStack- the item stack to be equipped, useItemStack.empty()to unset the item- See Also:
-
getEquipped
Retrieves the item stack currently swallowed by this sulfur cube.This method acts as a simple utility method to get the
EquipmentSlot.BODYequipment slot of this sulfur cube, which holds the sulfur cube's swallowed item.- Returns:
- the item stack in the
EquipmentSlot.BODYequipment slot, returnsItemStack.empty()if no item is present
-