#break mob spawner with mob inside
1 messages · Page 1 of 1 (latest)
And how can I implement this to
drop mob spawner at event-block``` this?
try to use that expression to get the entitytype, then drop 1 of {_entityType} spawner ...
Drops an error..
set {_type} to event-block's entity type
drop 1 of {_type} spawner at event-block
"%{_type}% spawner" parsed as item type at event-block
Maybe just drop a spawner with a string tag for the entity, then set the entity type to that on place
on top of that, instead of naming the item (because people can rename things in anvils), you should set a line of lore in the item to be the entity. I use this method for myself: Type: cave_spider
The spawner type will be on its own line, and the underscores are mandatory so the script doesn't get confused when it tries to get the lore (and for readability)
Then you can check the lore and see if it starts with "Type" and get the mob from there, then set the spawner type using the expression shown earlier on place
I tried.. I don't get it...
add 1 to {nmb}
set {spawner.type.%{nmb}%::%uuid of player%} to event-block's entity type
set name of event-block to "%event-block's entity type% - Spawner" with lore "Type: %event-block's entity type%"
on place:
if event-block is a spawner:
lore of event-block contains "Type":
set entity type of event-block to {spawner.type.%{nmb}%::%uuid of player%}
remove 1 from {nmb}}```
The {nmb} part is so that you can break several spawners and the mobs are saved and then the right mob is there when you place them. Definitely works better. But in general it doesn't even work...
Maybe someone can give me an example. I really can't figure it out...
The {nmb} variable is unnecessary, and can break if multiple people break the spawners at the same time. I believe another reason it's not working is because you are checking the lore of the block (blocks placed do not have lore), whereas you should be checking the lore of the player's tool
Alr. ```on break of mob spawner:
set {_item} to event-block
set {spawner.type::%uuid of player%} to event-block's entity type
set lore of {_item} to "Type: %event-block's entity type%"
set event-block to air
drop 1 of {_item} at event-block
on place:
if player's tool is a spawner:
lore of player's tool contains "Type":
set entity type of event-block to {spawner.type::%uuid of player%}```
I don't have any errors yet. The type is saved, the lore is set but as soon as I place the spawner it is a normal one
you may then need to
before you set the entity type of the spawner
Does not change anything
that works
whatever lore line its checking has to say that exactly though
you have to loop the tool's lore, then check if each loop-value contains a string if you wanted to check a partial match
Where do I have to loop that
wherever you wanted to put a loop in
Damn. It works
Thank you ❤️
if held item is a spawner:
loop the tool's lore:
loop-value contains "&6Mob:":
wait 1 tick
set event-block's entity type to {spawner.type::%uuid of player%}```
Like that it works. Is it as you thought?
sure 👍
Now another thing is, I can't save more than one mob because the last spawner I broke will be saved. How can I make that they save per spawner
But how do I set the spawner type then
you get it from the lore, not the variable
So I have to check the lore if it contains "pig" I have to set the type to pig. Doesn't it work automatically in any way?
wait 1 tick
set event-block's entity type to pig
if loop-value contains "creeper":
wait 1 tick
set event-block's entity type to creeper```
This, for example, works. But then I would have to list every mob...
no, just set it to the lore parsed as entity
set event-block's entity type to {_lore}```
There is no error but the mob is not set.
set a temp var to the uncolored loop-value, then replace your text
if held item is a spawner:
loop the tool's lore:
loop-value contains "&6Mob:":
set {_lore} to 1st line of tool's lore
replace every "&6Mob: " in {_lore} with ""
broadcast "%{_lore}%"
wait 1 tick
set event-block's entity type to {_lore} parsed as entity```
It's broadcasting the type but it does not set the type..
its broadcasting the string
but not parsing as an entity, because its not an entity
its an entitytype
I almost have it... Why does it have to be so complicated. 😭
an entity is a physical (well, in the world of Minecraft) entity. it has to be alive, and exist somewhere
And how can I do it then?.
parse as entitytype, not entity
THATS IT