1.16.x TreeType.CRIMSON_FUNGUS not working?!

Discussion in 'Spigot Plugin Development' started by Yorick, Oct 14, 2020.

  1. Hey!

    I currently have the code too spawn a tree:
    Code (Text):

    block.getLocation().getWorld().generateTree(block.getLocation(), TreeType.BIRCH);
    block.getLocation().getWorld().generateTree(block.getLocation(), TreeType.TREE);
    block.getLocation().getWorld().generateTree(block.getLocation(), TreeType.JUNGLE);
     
    Now I wanted to make it supported for the Fungus trees.
    Code (Text):

    block.getLocation().getWorld().generateTree(block.getLocation(), TreeType.CRIMSON_FUNGUS);
    block.getLocation().getWorld().generateTree(block.getLocation(), TreeType.WARPED_FUNGUS);
     
    But the one for an oak tree works, but for a fungus tree it spawns the tree in a total different location.
    But a normal tree spawns at the spot where te sapling was before. Sometimes it doesn't spawn a fungus tree at all!

    Does anyone know what I'm doing wrong?
     
    #1 Yorick, Oct 14, 2020
    Last edited: Oct 14, 2020
  2. Are you in the overworld or nether? Possible they only spawn in the nether.
     
  3. Don‘t you need the matching nyllium underneath to plant the tree? Try to set the block underneath accordingly
     
  4. In the overworld, they do spawn. But spawn at a random location. If you give in the same location it will spawn somewhere random every time. Aslong as its on the according Nyllium,

    Yes they needed the matching nyllium, even with doing that it does not solve the issue :S
     
  5. Here, i made a quick video of what is happening. Maybe it helps to visualize my problem.

    Console response:
    Code (Text):

    [11:29:02] [Server thread/INFO]: NETHER ITEM FOUND
    [11:29:02] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=270.0,y=75.0,z=-81.0,pitch=0.0,yaw=0.0}
    [11:29:02] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=270.0,y=75.0,z=-81.0,pitch=0.0,yaw=0.0}
    [11:30:31] [Server thread/INFO]: NETHER ITEM FOUND
    [11:30:31] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:31] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:33] [Server thread/INFO]: NETHER ITEM FOUND
    [11:30:33] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:33] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:36] [Server thread/INFO]: NETHER ITEM FOUND
    [11:30:36] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:36] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:37] [Server thread/INFO]: NETHER ITEM FOUND
    [11:30:37] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:37] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=315.0,y=80.0,z=54.0,pitch=0.0,yaw=0.0}
    [11:30:42] [Server thread/INFO]: NETHER ITEM FOUND
    [11:30:42] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=311.0,y=80.0,z=47.0,pitch=0.0,yaw=0.0}
    [11:30:42] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=311.0,y=80.0,z=47.0,pitch=0.0,yaw=0.0}
     

    Code it executes:
    Code (Text):

    System.out.println("NETHER ITEM FOUND");
    System.out.println(block.getLocation());

    block.setType(Material.AIR);
    block.getLocation().getWorld().generateTree(block.getLocation(), TreeType.WARPED_FUNGUS);
               
    System.out.println(block.getLocation());
     
    What happens in-game:


    EDIT: I think the last time, it spawned all the tree's it couldn't spawn before.
     
    #5 Yorick, Oct 15, 2020
    Last edited: Oct 15, 2020
  6. Try a similar thing in Vanilla.
    Judging by the randomness, this could be a Client-side handler?
    (Or, which may have not yet been impemented in the SpigotAPI ?)
     
    #6 Goldentoenail, Oct 16, 2020
    Last edited: Oct 16, 2020
  7. It triggers on a player event, but the Oak, Spruce, Birch etc work fine. Why does the fungus types not?