I’m trying to spawn baby zombie
but it keeps failing
I tried
ZOMBIE.getAgeData().baby().set(true);
and
ZOMBIE.getAgeData().age().set(0);
none of all I could come out does not work.
help me please
This is because when you get the data from an object, it is a copy of the data.
In this case because you’re just setting a value, use ZOMBIE.set(Keys.AGE, 0)
For more, check the Data API docs: https://docs.spongepowered.org/en/plugin/data/index.html
code you suggested does not work.
and I tried
ZOMBIE.offer(Keys.AGE,1)
but it doesnt work either
JBYoshi
4
A negative age represents a baby. A positive or zero age represents an adult.
ZOMBIE.offer(Keys.AGE, -10000)
is it possible to make zombie not to grow forever? to keep him being baby
gabizou
6
You could offer Integer.MIN_VALUE
and they’d basically stay a baby for a very long time.
zombie is still adult.
I also tried
ZOMBIE.getAgeData().set(Keys.AGE,-10000);
this occurs NoSuchElemental Exception error.
Tzk
8
According to this issue AgeableData isn’t implemented yet, sorry
The API we’ve shown is complete, however you will not yet be able to use/test with it until it has been implemented.
The list of unimplemented data shows @HassanS6000 as being the one who is implementing it.