Minecraft Blogs / Tutorial

Custom Splash Potion Spawners (1.10)

  • 1,808 views, 2 today
  • 2
  • 0
ChaoticLogic's Avatar ChaoticLogic
Level 31 : Artisan Button Pusher
5
It took me a bit of digging to pull this out of the web, so I'm storing the information here for easy access later.

To create a custom splash potions spawner that simply bursts the potion when you get near it, use a command block with this code:

/setblock ~ ~1 ~ minecraft:mob_spawner 0 replace {SpawnData:{id:"ThrownPotion",Potion:{id:"minecraft:splash_potion",Count:1b,tag:{CustomPotionEffects:[{Id:10b,Amplifier:1b,Duration:600},]}}},SpawnCount:3s,SpawnRange:2s,RequiredPlayerRange:4s,Delay:10s,MinSpawnDelay:100s,MaxSpawnDelay:200s,MaxNearbyEntities:4s}

The first three "~" after setblock is relative location. In this case, z+1, putting the spawner on top of the command block. Change to -1 to put it under the command block.

The item codes are no longer numerical, hence "ThrownPotion" and "minecraft:splash_potion", but the effect ID's are. In this example, "id:10b" makes it a regen potion.

Full potion ID list here: https://mcreator.pylo.co/wiki/index.php/Potion_Effect_IDs

Walkthrough of spawner specific values: https://www.youtube.com/watch?v=TKqhUGLKRo4

Quick reference:
SpawnCount: number of possible entities to spawn. In this case, between 1 and 3.
SpawnRange: how many blocks from the spawner can the entity spawn
RequiredPlayerRange: how close must the player be to trigger the spawner
Delay: how long after the player is in range will it wait to spawn the first entity (measured in ms)
MinSpawnDelay and MaxSpawnDelay: defines the window within which an entity will spawn again
MaxNearbyEntities: checks SpawnRange and if the number defined here is greater than the number of entities within range, it will spawn more, up to this number. Good idea to set this as (SpawnCount)+1
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome