Technical Details

CHANGES IN 1.9

  • Spawn eggs now use NBT data EntityTag.id instead of durability field, leads to texture issue and 0 spawning issues otherwise
  • EntityId as BlockEntityTag has been deprecated
  • Spawners had SpawnPotentials set, even without explicitly setting it, overwriting SpawnData after first spawn.
  • Main and offhand are now supported and need to be checked

SilkSpawners stores the entity ID of creature within the mob spawner item:

  • Durability (damage value) - this works only for Minecraft =1.8
  • Custom NBT tag: {SilkSpawners:{entityID:<MobID>}} - stored as a short
  • Vanilla NBT tag: {BlockEntityTag:{EntityId:<MobName>}} - stored as a string
  • Lore (fallback): entityID: <MobID> - this works in any line of the lore

A note about useLegacyName this feature should not relied on, unless necessary. It tries to guess the mob id from the spawner name. (ItemMeta, displayname)

It is recommended to use SilkUtil to receive the mob ID and to set the mob ID since it handles all the version dependent NMS code.

When a spawner block is broken, a spawner item drops with the appropriate entity ID stored, obtained from the creature spawner tile entity (CraftCreatureSpawner).
When a spawner block is placed, the entity ID is read from the item and the spawner creature type is set (using the CreatureSpawner BlockState).

EntityIDs of the vanilla mobs.

Bukkit provides an EntityType wrapper, but it is implemented using an enum which cannot be easily extended by mods (without using reflection, as they do for the ItemStack wrapper), so SilkSpawners does not use this enum when possible, and instead directly accesses the net.minecraft.server classes if it can.
If it fails or if useReflection is false, SilkSpawners will fallback to the EntityType wrapper.


Comments

Posts Quoted:
Reply
Clear All Quotes