- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 26
- Points
- 0
Hey,
I wanted to get a spawnegg wich is modified with nbt tags.
My problem is i only get a white spawnegg and i dont know how to set the Entity Id to the spawnegg. Currently i got this:
Notiz: Der neue Code steht weiter unten in diesem Thread.
-Slimig (Master_Coder)
I wanted to get a spawnegg wich is modified with nbt tags.
My problem is i only get a white spawnegg and i dont know how to set the Entity Id to the spawnegg. Currently i got this:
Code:
ItemStack itm = new ItemStack(Items.spawn_egg);
NBTTagCompound base = new NBTTagCompound();
NBTTagCompound entityTag = new NBTTagCompound();
entityTag.setString("id", "Creeper");
NBTTagList pos = new NBTTagList();
pos.appendTag(new NBTTagDouble(x));
pos.appendTag(new NBTTagDouble(y));
pos.appendTag(new NBTTagDouble(z));
entityTag.setTag("Pos", pos);
entityTag.setInteger("Fuse", 0);
entityTag.setInteger("ExplosionRadius", 30);
base.setTag("EntityTag", entityTag);
itm.setTagCompound(base);
Notiz: Der neue Code steht weiter unten in diesem Thread.
-Slimig (Master_Coder)
30.09.2018 - by FantaCoke
- Code neu formatiert
- Notiz hinzugefügt
- Code neu formatiert
- Notiz hinzugefügt
Last edited by a moderator: