Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/18/20 in all areas

  1. Instead of adding the spawns in your biome constructor, add them in FMLCommonSetupEvent, then everything is registered. Not 100% sure on the current method of adding spawn eggs though
    1 point
  2. Howdy. You can detect the effects of players breaking a block on the client side, if they're within your render distance. That might be enough for you? Your client-side code could check the location of all players, every tick. And then you could look at the blocks within a reasonable radius of each player, to see if they have changed (been broken, TNT has been placed, etc). Might be better than nothing, if you have no way to install a mod on the server. -TGG
    1 point
  3. This code is awful. Do not compare things to strings. entity.getItem().getItem() == Items.DIAMOND. The event is only fired on the server side. When you connect to a dedicated server, that server is the logical server, but also the physical server. Because it is physically elsewhere. However when you play single player, the physical client runs its own integrated server locally on a separate thread, this is the logical server located at the physical client. When you do something on the logical server that accesses something on the logical client, that's known as "reaching across sides." It works only because the two threads are running in the same JVM. But because they are different process threads you'll sometimes get random and unexpected crashes.
    1 point
  4. You're reaching across logical sides. You can't do this.
    1 point
  5. I have come across this bug and therefore it makes building certain redstone structures pretty hard. I tested this in Minecraft 1.15.2 Forge version 31.2.0 no other mods installed just forge. This does not happen in a vanilla game any chance of a fix? I like to run forge so i can run map mods on a vanilla game basically but cant as this breaks some of my redstone contraptions
    1 point
  6. Ah, actually I know what the problem is. This AABB is zero-volume and cannot contain any entities. Look at how vanilla entities like the hopper define their collection volume.
    1 point
  7. Have you tried Right Click on Project -> Refresh? Eclipse does not automatically refresh if there are changes done on the disk (that is not managed by Eclipse). Seems to be fixed.
    1 point
  8. Yes, like lIyemu said, you can use the getSpawns method for every biome. You can iterate through them all by using java stream. You can then to .add and add your entity. Allow me to show you an example: package <idk, whatever package name you want>; import <wherever you keep static references to your entities>; import net.minecraft.entity.EntityClassification; import net.minecraft.world.biome.Biome.SpawnListEntry; import net.minecraftforge.registries.ForgeRegistries; public class ModEntitySpawn { public static void spawnMobs() { ForgeRegistries.BIOMES.getValues().stream() //This is just some randsom filtering but do whatever you want her, or dont filter at all //if you want your entity to appear anywhere. .filter(biome -> biome.getRegistryName().toString().equals("minecraft:mushroom_fields") || biome.getRegistryName().toString().equals("minecraft:mushroom_fields_field_shore")) //this is the main dish .forEach(biome -> { biome.getSpawns(EntityClassification.<depends on what you want>) //min and max refer to number of entities in a group. .add(new SpawnListEntry(<static reference to your entity>, <weight>, <min>, <max>)); }); } } Then you have to register it in your event subscriber: @SubscribeEvent public static void onLoadSpawns (FMLCommonSetupEvent event) { ModEntitySpawn.spawnMobs(); } I hope this is helpful! good luck!
    1 point
  9. You register stuff under the same registry name as the entry you would like to override. As for the shulker block, you might also have to change the constant under the Blocks class. Your custom shulker block should return an instance of your tile entity in createTileEntity.
    1 point
×
×
  • Create New...

Important Information

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