Jump to content

Cadiboo

Members
  • Posts

    3624
  • Joined

  • Last visited

  • Days Won

    58

Posts posted by Cadiboo

  1. 1 hour ago, Hoping1 said:

    I'm confused. You mean don't register the spawn egg until the entity registry event?

    No.

    Item Registry Event:

    - Create EntityType
    - Create and register Spawn Egg

    EntityType Registry Event:
    - Register EntityType

    1 hour ago, Hoping1 said:

    No, I haven't. Where do I find the vanilla code?

    In External/Referenced Libraries in your IDE. I assume spawning entities would be in ServerWorld.

    • Thanks 1
  2. 3 hours ago, Hoping1 said:

    Fair enough, I'll change it. Do you know what's wrong with my natural spawn algorithm?

    No, but I’m general static initialisers are bad and you shouldn’t use them. It’s unlikely that this is the cause of it, but you should fix it anyway (you’ll need to create your entity entry but not register it in your item registry event to register it’s spawn egg, then register it in the entity registry event). Have you tried looking at vanilla’s code to see how it gets a creature to spawn? Working back from that code should allow you see why yours isn’t working.

     

  3. 7 hours ago, Hoping1 said:

    That line can't possibly be the reason it's broken unless I'm very confused about java. I got it from a tutorial but it makes sense to me.

    It’s not the reason it’s broken, it’s just useless code. This is your own internal method that you’re using - you never pass null into your method (and obviously shouldn’t) so the check is pointless. However, if you accidentally do pass null into this method (because an objectholder failed or you forgot to create a biome) you’re not going to want it to just fail silently - you’re going to want to know about it.

  4. It is possible but leads to crashes if something tries to reference those items (even if it’s just a json recipe). So you shouldn’t do it. The best way to do this would be to remove the item from all creative tabs and remove its recipe. That way ops can still get the item with /give but normal players can’t get it. If you want to go a step further you can create an event handler that scans players inventories for the item and removes it (and hopefully tells the player about it).

    • Like 1
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.