endercrystal

Discussion in 'Plugin Development' started by Scorpionvssub, Apr 9, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Scorpionvssub

    Im stuck on endercrystal spawns...

    I can spawn in a crystal just fine with 1.9 plugin wise, but those are with a bedrock block underneath, while for players there are crystals that do not have that, how can i create those via plugins?

    Trying my best to explain it but in short:

    Using the plugins spawnentity creates an endercrystal with a block underneath(a slab type block)
    Players that place a endercrystal which can only be done on bedrock does not have this slab,
    I tried to get that crystal even via using the break entity get type to array and attempt to "create a copy" but no luck..
     
  2. Well endercrystals are supposed to have that slab underneath, because that is part of the entity. Like a sort of spawn pad. The item version is not something you can just 'get' in-game without a command, so it will act as placing a block and not spawning an entity
     
  3. Offline

    Lightspeed

    So whenever we spawn ender crystals they come with there own slab free(Sounds like a deal to me)?
     
  4. Offline

    mcdorli

    @Harieo @Lightspeed You should sometimes do some research.

    To create an endercrystal without the bottom slab, you need to set the showBottom NBT attribute to 0.
     
  5. Offline

    Scorpionvssub

    yea but the issue is @mcdorli i cant get that option on entityspawn event or on a method thatcreates the crystal so... x)
     
  6. Offline

    mcdorli

    You spawn a simply endercrystal with world.spawn(Location loc, Class entityClass), you save it (cast to and ender crystal), then you can edit it's atribute list.
     
  7. Offline

    Scorpionvssub

    @mcdorli both don't give the option..


    Code:
        private void crystaltest(Player p) {
            Location loc = p.getLocation();
            EnderCrystal crystal = (EnderCrystal) loc.getWorld().spawnEntity(loc, EntityType.ENDER_CRYSTAL);
        }
    
        @EventHandler
        private void onEntitySpawn(EntitySpawnEvent e) {
            if (e.getEntity() instanceof EnderCrystal) {
                EnderCrystal cr = (EnderCrystal) e.getEntity();
            }
        }
     
  8. Offline

    mcdorli

    Nbt tags can't be edited trough bukkit methods, you need to use nms.
     
  9. Offline

    Scorpionvssub

    ow.... X) uhhhh yea...

    That the only way?

    In the end what i wanna attempt is to create that crystal thats used to respawn the dragon, which the slabbed version is incapable off

    found a setbottomslab option via bukkit/spigot which szhould remove that slab underneath...doesn't do much thoug

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Apr 11, 2016
  10. Offline

    Lightspeed

    I was just trying to understand the problem . . .
     
Thread Status:
Not open for further replies.

Share This Page