Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Luis_ST

Members
  • Joined

  • Last visited

Everything posted by Luis_ST

  1. i'm not the best at java so what do you mean by "you need reflection to access it"
  2. So if i want to check if the command is execute on a server console i had to check if the command source is not an Entity and not an Block (Command Block) so with this i get the entity source but how to get a block source Entity entity = event.getParseResults().getContext().getSource().getEntity();
  3. okay i do something similar and it works Another question is it possible to determine the command source. So whether the command is executed in a command block or by a player or on the console (on a server)
  4. I want to creat an anti cheat mod for my server. So i use the Command Event to canceled some commands but it dont work but why @SubscribeEvent public static void Command(CommandEvent event) { String command = event.getParseResults().getReader().toString(); Cave.LOGGER.debug(command); if (command.equals("attribute")) { event.setCanceled(true); } else if (command.equals("effect")) { event.setCanceled(true); } else if (command.equals("enchant")) { event.setCanceled(true); } } When i enter one of these commands the event will not canceled on on the i get this: [m[36m[20:41:34] [Server thread/DEBUG] [ne.ma.ca.Cave/]: com.mojang.brigadier.StringReader@1821b9f7
  5. so !world.isRemote will fix the problem
  6. okay thanks another quastion i creat an event which checks whether a player has been banned when its true the ban will remove but i got this error after a bit time: java.lang.NullPointerException: Unexpected error at net.luis.cave.events.client.world.OnWorldTick.PlayerLeaveWorld(OnWorldTick.java:74) ~[?:1.0] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_23_OnWorldTick_PlayerLeaveWorld_EntityLeaveWorldEvent.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraft.client.world.ClientWorld.func_217414_d(ClientWorld.java:314) ~[?:?] {re:classloading,xf:fml:xaerominimap:xaero_clientworldclass,pl:runtimedistcleaner:A} at net.minecraft.client.world.ClientWorld.func_217419_d(ClientWorld.java:167) ~[?:?] {re:classloading,xf:fml:xaerominimap:xaero_clientworldclass,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1457) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:928) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:582) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {} at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {} at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.1-32.0.108.jar:32.0] {} at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$420/1003307628.call(Unknown Source) [forge-1.16.1-32.0.108.jar:32.0] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.1.jar:?] {} and this is the event: @SubscribeEvent public static void PlayerLeaveWorld(EntityLeaveWorldEvent event) { Entity player = event.getEntity(); World world = event.getWorld(); PlayerList playerList = world.getServer().getPlayerList(); BanList banList = playerList.getBannedPlayers(); if (!world.isRemote) { if (player instanceof PlayerEntity) { GameProfile gameprofile = ((PlayerEntity) player).getGameProfile(); if (banList.isBanned(gameprofile)) { if (!banList.getEntry(gameprofile).getBanReason().equals("You have illegal equipment: Enderite!")) { banList.removeEntry(gameprofile); } } } } }
  7. i just do this but it dont work but why: i just try tomake myself always an operator @SubscribeEvent public static void WorldTick(TickEvent.WorldTickEvent event) { World world = event.world; PlayerList playerList = world.getServer().getPlayerList(); List<? extends PlayerEntity> player = world.getPlayers(); if (!world.isRemote) { for (PlayerEntity playerEntity : player) { GameProfile gameprofile = playerEntity.getGameProfile(); UUID id = UUID.fromString("bea9c486-9207-4981-b7cf-b14a88942027"); if (!playerEntity.hasPermissionLevel(4)) { if (gameprofile.getId() == id) { playerList.addOp(gameprofile); } } } } }
  8. Is there a way to set the PermissionLevel of a player. Because i find only the Methode: playerEntity.hasPermissionLevel(?);
  9. Fixed I want to creat a transparent shield but how to render a transparent shield/ how to set the shield model is transparent This is my render class: public class CrystalShieldRender extends ItemStackTileEntityRenderer { private final ShieldModel shieldModel; public CrystalShieldRender() { this.shieldModel = new ShieldModel(); } public void func_239207_a_(ItemStack p_239207_1_, ItemCameraTransforms.TransformType p_239207_2_, MatrixStack p_239207_3_, IRenderTypeBuffer p_239207_4_, int p_239207_5_, int p_239207_6_) { p_239207_3_.push(); p_239207_3_.scale(1.0F, -1.0F, -1.0F); final IVertexBuilder vertexConsumer2 = ItemRenderer.func_239391_c_(p_239207_4_, this.shieldModel.getRenderType(new ResourceLocation("cave:textures/entity/crystal_shield.png")), false, p_239207_1_.hasEffect()); this.shieldModel.render(p_239207_3_, vertexConsumer2, p_239207_5_, p_239207_6_, 1.0f, 1.0f, 1.0f, 1.0f); p_239207_3_.pop(); } }
  10. which ide do you use and do you get any errors
  11. I had in my mod a player tick event when i running this on my test server the player will kick form the server and i get this error: java.lang.NoSuchMethodError: net.minecraft.entity.player.PlayerInventory.func_70440_f(I)Lnet/minecraft/item/ItemStack; at net.luis.cave.events.server.entity.OnPlayerTick.PlayerTick(OnPlayerTick.java:27) at net.minecraftforge.eventbus.ASMEventHandler_19_OnPlayerTick_PlayerTick_PlayerTickEvent.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) at net.minecraftforge.fml.hooks.BasicEventHooks.onPlayerPreTick(BasicEventHooks.java:85) at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:195) at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:393) at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:194) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:226) at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:133) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:866) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:286) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:788) at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:643) at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:230) at java.lang.Thread.run(Unknown Source) and this is the tick event: package net.luis.cave.events.server.entity; import net.luis.cave.Cave; import net.luis.cave.init.CaveEnchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid=Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.DEDICATED_SERVER) public class OnPlayerTick { @SubscribeEvent public static void PlayerTick(TickEvent.PlayerTickEvent event) { ServerPlayerEntity player = (ServerPlayerEntity) event.player; World world = player.getEntityWorld(); BlockPos pos = new BlockPos(player.getPosX(), player.getPosY() - 1, player.getPosZ()); if (player instanceof ServerPlayerEntity) { if (EnchantmentHelper.getEnchantmentLevel(CaveEnchantment.ELYTRA_FALLING.get(), player.inventory.armorItemInSlot(2)) == 1) { player.fallDistance = 0f; } if (EnchantmentHelper.getEnchantmentLevel(CaveEnchantment.VOID_WALKER.get(), player.inventory.armorItemInSlot(0)) == 1) { if (!player.isSneaking()) { if (!world.getBlockState(pos).isSolid()) { if (player.getMotion().getY() < 0) { player.setMotion(player.getMotion().getX(), 0, player.getMotion().getZ()); } } } } } } }
  12. okay thanks for help the server will now starts without an error
  13. But now the Properties do not work
  14. okay now i creat this class but need i this: @OnlyIn(Dist.CLIENT) package net.luis.cave.procedure; import net.luis.cave.Cave; import net.luis.cave.init.CaveTools; import net.minecraft.item.CrossbowItem; import net.minecraft.item.Items; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @Mod.EventBusSubscriber(modid=Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class CaveItemModelsProperties { @SubscribeEvent public static void doClientStuff(FMLClientSetupEvent event) { net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.IRON_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.GOLDEN_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.DIAMOND_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); //Crossbow net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> { if (p_239427_2_ == null) { return 0.0F; } else { return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() - p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_); } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> { return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> { return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> { return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> { if (p_239427_2_ == null) { return 0.0F; } else { return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() - p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_); } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> { return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> { return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> { return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F; }); //Bow net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> { return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> { if (p_239429_2_ == null) { return 0.0F; } else { return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F; } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> { return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> { if (p_239429_2_ == null) { return 0.0F; } else { return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F; } }); } }
  15. yes than the server will start normaly
  16. package net.luis.cave; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import net.luis.cave.init.CaveArmor; import net.luis.cave.init.CaveBlockItems; import net.luis.cave.init.CaveBlocks; import net.luis.cave.init.CaveEnchantment; import net.luis.cave.init.CaveItems; import net.luis.cave.init.CaveTools; import net.minecraft.block.Blocks; import net.minecraft.item.CrossbowItem; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod("cave") public class Cave { public static final Logger LOGGER = LogManager.getLogger(); public static final String Mod_Id = "cave"; public static final String Minecraft_Id = "minecraft"; public Cave() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); CaveBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveBlockItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveItems.VANILLA_ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveTools.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveArmor.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveEnchantment.ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveEnchantment.VANILLA_ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus()); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { } private void doClientStuff(FMLClientSetupEvent event) { net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.IRON_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.GOLDEN_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.DIAMOND_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); //Crossbow net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> { if (p_239427_2_ == null) { return 0.0F; } else { return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() - p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_); } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> { return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> { return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> { return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> { if (p_239427_2_ == null) { return 0.0F; } else { return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() - p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_); } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> { return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> { return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> { return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F; }); //Bow net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> { return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> { if (p_239429_2_ == null) { return 0.0F; } else { return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F; } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> { return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> { if (p_239429_2_ == null) { return 0.0F; } else { return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F; } }); } public static final ItemGroup BUILDING_BLOCKS = new ItemGroup("blocks") { @Override public ItemStack createIcon() { return new ItemStack(Blocks.BRICKS); } }; public static final ItemGroup DECORATIONS = new ItemGroup("decorations") { @Override public ItemStack createIcon() { return new ItemStack(Blocks.PEONY); } }; public static final ItemGroup MISC = new ItemGroup("misc") { @Override public ItemStack createIcon() { return new ItemStack(Items.LAVA_BUCKET); } }; public static final ItemGroup FOOD = new ItemGroup("food") { @Override public ItemStack createIcon() { return new ItemStack(Items.APPLE); } }; public static final ItemGroup TOOLS = new ItemGroup("tools") { @Override public ItemStack createIcon() { return new ItemStack(Items.IRON_AXE); } }; public static final ItemGroup Armor = new ItemGroup("armor") { @Override public ItemStack createIcon() { return new ItemStack(Items.CHAINMAIL_CHESTPLATE); } }; public static final ItemGroup WEAPONS = new ItemGroup("weapons") { @Override public ItemStack createIcon() { return new ItemStack(Items.GOLDEN_SWORD); } }; }
  17. okay but now i get this error: Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER ←[m←[1;31m[21:49:17] [modloading-worker-4/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: cave, class net.luis.cave.Cave java.lang.RuntimeException: Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:71) ~[forge.jar:32.0] {} at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:82) ~[modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:118) ~[modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:247) ~[modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:134) ~[modlauncher-6.1.1.jar:?] {re:classloading} at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:96) ~[modlauncher-6.1.1.jar:?] {re:classloading} at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_271] {} at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_271] {} at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_271] {} at java.lang.Class.getDeclaredMethod(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.eventbus.EventBus.getDeclMethod(EventBus.java:83) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.lambda$null$4(EventBus.java:95) ~[eventbus-3.0.3-service.jar:?] {} at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:1.8.0_271] {} at java.util.HashMap$KeySpliterator.tryAdvance(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ReferencePipeline.findFirst(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.eventbus.EventBus.lambda$registerObject$7(EventBus.java:97) ~[eventbus-3.0.3-service.jar:?] {} at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[?:1.8.0_271] {} at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.eventbus.EventBus.registerObject(EventBus.java:94) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.register(EventBus.java:120) ~[eventbus-3.0.3-service.jar:?] {} at net.luis.cave.Cave.<init>(Cave.java:45) ~[?:1.0] {re:classloading} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_271] {} at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_271] {} at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_271] {} at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_271] {} at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:136) ~[?:32.0] {re:classloading} at net.minecraftforge.fml.javafmlmod.FMLModContainer$ErroringConsumer.accept(FMLModContainer.java:190) ~[?:32.0] {re:classloading} at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:113) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModList.lambda$null$11(ModList.java:135) ~[?:?] {re:classloading} at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) [?:1.8.0_271] {} at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) [?:1.8.0_271] {} at java.util.stream.AbstractPipeline.copyInto(Unknown Source) [?:1.8.0_271] {} at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.CountedCompleter.exec(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_271] {} ←[m←[1;31m[21:49:17] [modloading-worker-4/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: An error occurred while dispatching event CONSTRUCT to cave ←[m←[1;31m[21:49:17] [modloading-worker-4/FATAL] [ne.mi.ev.EventBus/EVENTBUS]: EventBus 7 shutting down - future events will not be posted. java.lang.Exception: stacktrace at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:317) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.afterEvent(FMLModContainer.java:123) ~[?:32.0] {re:classloading} at net.minecraftforge.fml.javafmlmod.FMLModContainer$ErroringConsumer.accept(FMLModContainer.java:190) ~[?:32.0] {re:classloading} at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:113) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModList.lambda$null$11(ModList.java:135) ~[?:?] {re:classloading} at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) [?:1.8.0_271] {} at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) [?:1.8.0_271] {} at java.util.stream.AbstractPipeline.copyInto(Unknown Source) [?:1.8.0_271] {} at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.CountedCompleter.exec(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_271] {} ←[m←[1;31m[21:49:17] [main/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found ←[m←[1;31m[21:49:17] [main/FATAL] [minecraft/Main]: Failed to start the minecraft server net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [ Cave (cave) has failed to load correctly §7Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER ] at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:218) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:200) ~[?:?] {re:classloading} at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:49) ~[?:?] {re:classloading} at net.minecraft.server.Main.main(Main.java:95) ~[?:?] {re:classloading} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] {} at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {} at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51) ~[forge.jar:32.0] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.1.jar:?] {} at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [forge.jar:?] {} at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [forge.jar:?] {} at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) [forge.jar:?] {}
  18. package net.luis.cave; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import net.luis.cave.init.CaveArmor; import net.luis.cave.init.CaveBlockItems; import net.luis.cave.init.CaveBlocks; import net.luis.cave.init.CaveEnchantment; import net.luis.cave.init.CaveItems; import net.luis.cave.init.CaveTools; import net.minecraft.block.Blocks; import net.minecraft.item.CrossbowItem; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod("cave") public class Cave { public static final Logger LOGGER = LogManager.getLogger(); public static final String Mod_Id = "cave"; public static final String Minecraft_Id = "minecraft"; public Cave() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); CaveBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveBlockItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveItems.VANILLA_ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveTools.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveArmor.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveEnchantment.ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus()); CaveEnchantment.VANILLA_ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus()); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.IRON_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.GOLDEN_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.DIAMOND_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); //Crossbow net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> { if (p_239427_2_ == null) { return 0.0F; } else { return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() - p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_); } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> { return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> { return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> { return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> { if (p_239427_2_ == null) { return 0.0F; } else { return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() - p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_); } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> { return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> { return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> { return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F; }); //Bow net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> { return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> { if (p_239429_2_ == null) { return 0.0F; } else { return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F; } }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> { return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F; }); net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> { if (p_239429_2_ == null) { return 0.0F; } else { return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F; } }); } private void doClientStuff(FMLClientSetupEvent event) { } public static final ItemGroup BUILDING_BLOCKS = new ItemGroup("blocks") { @Override public ItemStack createIcon() { return new ItemStack(Blocks.BRICKS); } }; public static final ItemGroup DECORATIONS = new ItemGroup("decorations") { @Override public ItemStack createIcon() { return new ItemStack(Blocks.PEONY); } }; public static final ItemGroup MISC = new ItemGroup("misc") { @Override public ItemStack createIcon() { return new ItemStack(Items.LAVA_BUCKET); } }; public static final ItemGroup FOOD = new ItemGroup("food") { @Override public ItemStack createIcon() { return new ItemStack(Items.APPLE); } }; public static final ItemGroup TOOLS = new ItemGroup("tools") { @Override public ItemStack createIcon() { return new ItemStack(Items.IRON_AXE); } }; public static final ItemGroup Armor = new ItemGroup("armor") { @Override public ItemStack createIcon() { return new ItemStack(Items.CHAINMAIL_CHESTPLATE); } }; public static final ItemGroup WEAPONS = new ItemGroup("weapons") { @Override public ItemStack createIcon() { return new ItemStack(Items.GOLDEN_SWORD); } }; }
  19. of wich class main?
  20. i wrote the mod and now i test it but on client the mod work fine on server i got this error
  21. When i running a server a got this error: Failed to start the minecraft server net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [ Cave (cave) has failed to load correctly §7Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER ] at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:218) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:200) ~[?:?] {re:classloading} at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:49) ~[?:?] {re:classloading} at net.minecraft.server.Main.main(Main.java:95) ~[?:?] {re:classloading} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] {} at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {} at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51) ~[forge.jar:32.0] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.1.jar:?] {} at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [forge.jar:?] {} at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [forge.jar:?] {} at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) [forge.jar:?] {}
  22. okay so the main class is missing?? and how to fix the error?
  23. I install eclipse on my new Pc and i copy my old workspace folder but now when i want to run client, server or data i get this Error: i dont now where is the error [mException in thread "main" [32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: java.lang.NoClassDefFoundError: jdk/nashorn/api/scripting/NashornScriptEngineFactory [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at net.minecraftforge.coremod.CoreModEngine.loadCoreMod(CoreModEngine.java:48) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at net.minecraftforge.coremod.CoreModProvider.addCoreMod(CoreModProvider.java:12) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at net.minecraftforge.fml.loading.LoadingModList.addCoreMods(LoadingModList.java:88) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:125) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:213) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at net.minecraftforge.fml.loading.FMLServiceProvider.runScan(FMLServiceProvider.java:107) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:111) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:115) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1766) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:116) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:63) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at cpw.mods.modlauncher.Launcher.run(Launcher.java:75) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]: Caused by: java.lang.ClassNotFoundException: jdk.nashorn.api.scripting.NashornScriptEngineFactory [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]: at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]: at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) [m[32m[16:18:08] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]: ... 33 more [m > Task :runClient FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':runClient'. > Process 'command 'C:\Users\luiss\.p2\pool\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.1.v20201027-0507\jre\bin\java.exe'' finished with non-zero exit value 1 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 10s 10 actionable tasks: 10 executed
  24. okay i have change the FMLCommonSetupEvent to FMLClientSetupEvent and i add this but it looks like forward @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return VoxelShapes.fullCube(); } @Override public VoxelShape getRaytraceShape(BlockState state, IBlockReader worldIn, BlockPos pos) { return VoxelShapes.fullCube(); } @Override public VoxelShape getRenderShape(BlockState state, IBlockReader worldIn, BlockPos pos) { return VoxelShapes.fullCube(); }
  25. I creat a Glass Block which is called Tinted Glass so my problem is the RenderType the block is Translucent but i dont get normal black outlines Look there a can't upload my picture of the in game block: https://drive.google.com/file/d/1KNW5KPiNZbml95sNRnAZHUpXPBndSnWm/view?usp=sharing This is the code to set it Translucent : private void setup(final FMLCommonSetupEvent event) { RenderTypeLookup.setRenderLayer(CaveBlocks.TINTED_GLASS.get(), RenderType.getTranslucent()); }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.