Jump to content

(My own server) Mods show up in creative inventory but modded items don't work. When I press a key, command prompt closes.


Recommended Posts

Posted

C:\Users\Roman\Desktop\Quantum Craft>REM Forge requires a configured set of both JVM and program arguments.

C:\Users\Roman\Desktop\Quantum Craft>REM Add custom JVM arguments to the user_jvm_args.txt

C:\Users\Roman\Desktop\Quantum Craft>REM Add custom program arguments {such as nogui} to this file in the next line before the  or

C:\Users\Roman\Desktop\Quantum Craft>REM  pass them to this script directly

C:\Users\Roman\Desktop\Quantum Craft>java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.18.2-40.2.0/win_args.txt
2023-03-12 13:27:46,700 main WARN Advanced terminal features are not available in this environment
[13:27:46] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 40.2.0, --fml.mcVersion, 1.18.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220404.173914]
[13:27:46] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 9.1.3+9.1.3+main.9b69c82a starting: java version 17.0.6 by Oracle Corporation
[13:27:47] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/Roman/Desktop/Quantum%20Craft/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2314!/ Service=ModLauncher Env=SERVER
[13:27:47] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Roman\Desktop\Quantum Craft\libraries\net\minecraftforge\fmlcore\1.18.2-40.2.0\fmlcore-1.18.2-40.2.0.jar is missing mods.toml file
[13:27:47] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Roman\Desktop\Quantum Craft\libraries\net\minecraftforge\javafmllanguage\1.18.2-40.2.0\javafmllanguage-1.18.2-40.2.0.jar is missing mods.toml file
[13:27:47] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Roman\Desktop\Quantum Craft\libraries\net\minecraftforge\lowcodelanguage\1.18.2-40.2.0\lowcodelanguage-1.18.2-40.2.0.jar is missing mods.toml file
[13:27:47] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Roman\Desktop\Quantum Craft\libraries\net\minecraftforge\mclanguage\1.18.2-40.2.0\mclanguage-1.18.2-40.2.0.jar is missing mods.toml file
[13:27:47] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: No dependencies to load found. Skipping!
[13:27:50] [main/INFO] [mixin/]: Compatibility level set to JAVA_17
[13:27:50] [main/ERROR] [mixin/]: Mixin config radium.mixins.json does not specify "minVersion" property
[13:27:51] [main/ERROR] [mixin/]: Mixin config rubidium.mixins.json does not specify "minVersion" property
[13:27:51] [main/ERROR] [mixin/]: Mixin config radon.mixins.json does not specify "minVersion" property
[13:27:51] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [com.integral.enigmaticlegacy.MixinConnector]
[13:27:51] [main/INFO] [cp.mo.mo.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeserver' with arguments []
[13:27:51] [main/INFO] [Radium/]: Loaded configuration file for Radium: 100 options available, 0 override(s) found
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/system/Platform
        at TRANSFORMER/[email protected]/me.jellysquid.mods.sodium.client.SodiumPreLaunch.checkJemalloc(SodiumPreLaunch.java:24)
        at TRANSFORMER/[email protected]/me.jellysquid.mods.sodium.client.SodiumPreLaunch.onPreLaunch(SodiumPreLaunch.java:17)
        at TRANSFORMER/[email protected]/me.jellysquid.mods.sodium.mixin.SodiumMixinPlugin.onLoad(SodiumMixinPlugin.java:25)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.PluginHandle.onLoad(PluginHandle.java:119)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinConfig.onSelect(MixinConfig.java:707)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.selectConfigs(MixinProcessor.java:498)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:460)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131)
        at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50)
        at [email protected]/cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:110)
        at [email protected]/cpw.mods.cl.ModuleClassLoader.lambda$findClass$16(ModuleClassLoader.java:216)
        at [email protected]/cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:226)
        at [email protected]/cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:216)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:632)
        at java.base/java.lang.Class.forName(Class.java:545)
        at MC-BOOTSTRAP/[email protected]/net.minecraftforge.fml.loading.targets.CommonServerLaunchHandler.lambda$launchService$0(CommonServerLaunchHandler.java:32)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:106)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:77)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
        at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
        at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.system.Platform
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at [email protected]/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:134)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at [email protected]/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:134)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 31 more

C:\Users\Roman\Desktop\Quantum Craft>pause
Press any key to continue . . .

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • [16Jan2025 00:33:16.640] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 47.3.22, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [16Jan2025 00:33:16.649] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 21.0.5 by Oracle Corporation; OS Windows 10 arch amd64 version 10.0 [16Jan2025 00:33:18.382] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: ImmediateWindowProvider not loading because launch target is forgeserver [16Jan2025 00:33:18.395] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirector CoreMod initialized successfully! [16Jan2025 00:33:18.403] [main/INFO] [mixin-transmog/]: Mixin Transmogrifier is definitely up to no good... [16Jan2025 00:33:18.440] [main/INFO] [mixin-transmog/]: crimes against java were committed [16Jan2025 00:33:18.481] [main/INFO] [mixin-transmog/]: Original mixin transformation service successfully crobbed by mixin-transmogrifier! [16Jan2025 00:33:18.551] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/Admin/Desktop/1.20.1/mods/Connector-1.0.0-beta.46+1.20.1.jar%23209%23213!/ Service=ModLauncher Env=SERVER [16Jan2025 00:33:19.431] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\Admin\Desktop\1.20.1\libraries\net\minecraftforge\fmlcore\1.20.1-47.3.22\fmlcore-1.20.1-47.3.22.jar is missing mods.toml file [16Jan2025 00:33:19.435] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\Admin\Desktop\1.20.1\libraries\net\minecraftforge\javafmllanguage\1.20.1-47.3.22\javafmllanguage-1.20.1-47.3.22.jar is missing mods.toml file [16Jan2025 00:33:19.438] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\Admin\Desktop\1.20.1\libraries\net\minecraftforge\lowcodelanguage\1.20.1-47.3.22\lowcodelanguage-1.20.1-47.3.22.jar is missing mods.toml file [16Jan2025 00:33:19.441] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\Admin\Desktop\1.20.1\libraries\net\minecraftforge\mclanguage\1.20.1-47.3.22\mclanguage-1.20.1-47.3.22.jar is missing mods.toml file [16Jan2025 00:33:20.031] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File:  and Mod File: . Using Mod File:  [16Jan2025 00:33:20.034] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 30 dependencies adding them to mods collection [16Jan2025 00:33:20.849] [main/INFO] [org.sinytra.connector.locator.DependencyResolver/]: Dependency resolution found 0 candidates to load [16Jan2025 00:33:22.698] [main/INFO] [org.sinytra.connector.service.hacks.ModuleLayerMigrator/]: Successfully made module authlib transformable [16Jan2025 00:33:24.980] [main/INFO] [mixin/]: Compatibility level set to JAVA_17 [16Jan2025 00:33:25.433] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeserver' with arguments [] [16Jan2025 00:33:25.536] [main/WARN] [mixin/]: Reference map 'v_slab_compat-common-refmap.json' for v_slab_compat-common.mixins.json could not be read. If this is a development environment you can ignore this message [16Jan2025 00:33:25.691] [main/INFO] [ModernFix/]: Loaded configuration file for ModernFix 5.20.0+mc1.20.1: 86 options available, 0 override(s) found [16Jan2025 00:33:25.695] [main/INFO] [ModernFix/]: Applying Nashorn fix [16Jan2025 00:33:25.749] [main/INFO] [ModernFix/]: Applied Forge config corruption patch [16Jan2025 00:33:25.913] [main/WARN] [mixin/]: Reference map '' for mixins.blueprintfix.json could not be read. If this is a development environment you can ignore this message [16Jan2025 00:33:26.131] [main/WARN] [mixin/]: Reference map 'mes-forge-refmap.json' for mes-forge.mixins.json could not be read. If this is a development environment you can ignore this message [16Jan2025 00:33:26.185] [main/WARN] [mixin/]: Reference map 'coroutil.refmap.json' for coroutil.mixins.json could not be read. If this is a development environment you can ignore this message [16Jan2025 00:33:26.224] [main/INFO] [Puzzles Lib/]: Loading 129 mods:     - amendments 1.20-1.2.12     - another_furniture 1.20.1-3.0.1     - architectury 9.2.14     - ash_api 3.0.2+1.20.1     - athena 3.1.1     - autochefsdelight 1.0.5+forge     - azurelib 2.0.41     - balm 7.3.9         \-- kuma_api 20.1.8     - barteringstation 8.0.0     - betteradvancements 0.3.2.161     - betterdungeons 1.20-Forge-4.0.4     - betterendisland 1.20-Forge-2.0.6     - betterfortresses 1.20-Forge-2.0.6     - betterjungletemples 1.20-Forge-2.0.5     - bettermineshafts 1.20-Forge-4.0.4     - betteroceanmonuments 1.20-Forge-3.0.4     - betterstrongholds 1.20-Forge-4.0.3     - biomesoplenty 19.0.0.93     - blue_skies 1.3.31     - blueprint 7.1.0     - blueprintfix 1.0.0         \-- mixinsquared 0.2.0-beta.6     - bookshelf 20.2.13     - bygonenether 1.3.2     - caelus 3.2.0+1.20.1     - carryon 2.1.2.7     - charmofundying 6.5.0+1.20.1         \-- spectrelib 0.13.15+1.20.1     - chefsdelight 1.0.3-forge-1.20.1     - citadel 2.6.0     - clientcrafting 1.20.1-1.8     - cloth_config 11.1.136     - clumps 12.0.0.4     - collective 7.87     - comforts 6.4.0+1.20.1     - connectorextras 1.9.2+1.20.1         |-- amecsapi 1.5.3+mc1.20-pre1         |-- connectorextras_architectury_bridge 1.9.2+1.20.1         |-- connectorextras_continuity_compat 1.9.2+1.20.1         |-- connectorextras_emi_bridge 1.9.2+1.20.1         |-- connectorextras_energy_bridge 1.9.2+1.20.1         |-- connectorextras_geckolib_fabric_compat 1.9.2+1.20.1         |-- connectorextras_jei_bridge 1.9.2+1.20.1         |-- connectorextras_kubejs_bridge 1.9.2+1.20.1         |-- connectorextras_modmenu_bridge 1.9.2+1.20.1             \-- modmenu 7.2.2         |-- connectorextras_rei_bridge 1.9.2+1.20.1         |-- connectorextras_terrablender_bridge 1.9.2+1.20.1         |-- forgeconfigapiport 8.0.0         \-- reach_entity_attributes 2.4.0     - connectormod 1.0.0-beta.46+1.20.1     - coroutil 1.20.1-1.3.7     - corpse 1.20.1-1.0.17     - crabbersdelight 1.1.4     - crawlondemand 1.20.x-1.0.0     - curios 5.11.0+1.20.1     - decorative_blocks 4.1.3     - diagonalfences 8.1.3         \-- diagonalblocks 8.0.2     - dragon_mounts_patches 1.0.0         \-- mixinextras 0.4.1     - dragonmounts 1.2.3-beta     - dungeons_arise 2.1.58-1.20.x     - dynamic_fps 3.7.7     - easyanvils 8.0.2     - easymagic 8.0.1     - elevatorid 1.20.1-lex-1.9     - endersdelight 1.0.3     - everycomp 1.20-2.7.7     - explorations 1.20.1-1.6.1     - extra_compat 1.5.22     - farmers_structures 1.0.0     - farmersdelight 1.20.1-1.2.6     - featurerecycler 1.0.1     - forge 47.3.22     - formations 1.0.3     - formationsnether 1.0.3     - formationsoverworld 1.0.4     - framework 0.7.8     - friendsandfoes 3.0.6     - galosphere 1.20.1-1.4.1     - geckoanimfix 1.0.0     - geckolib 4.7     - geophilic 2.1.0-mc1.20u1.20.2     - geophilic_reforged 1.2.0     - glitchcore 0.0.1.1     - goblintraders 1.9.3     - hearth_and_home 1.20.1-2.0.3     - hearths 1.0.0-mc1.20u1.20.1     - illagerinvasion 8.0.6     - immediatelyfast 1.3.3+1.20.4     - jei 15.20.0.104     - jeresources 1.4.0.247     - justenoughbreeding 1.5.0     - justenoughprofessions 3.0.1     - mes 1.3.1-1.20-forge     - minecraft 1.20.1     - modernfix 5.20.0+mc1.20.1     - moonlight 1.20-2.13.45     - mowziesmobs 1.6.4     - mr_blossom_blade 1.2     - nebs 1.8.0     - netherportalfix 13.0.1     - nethersdelight 1.20.1-4.0     - paintings 11.0.0.2     - palegarden 1.0.7     - pet_cemetery 2.0.0     - puzzleslib 8.1.25         \-- puzzlesaccessapi 8.0.7     - repurposed_structures 7.1.15+1.20.1-forge     - revampedwolf 1.20.1-5.0.0     - shieldexp 1.1.7a     - smarterfarmers 1.20-2.1.0     - sodiumoptionsmodcompat 1.0.0     - structorytowers 1.0.5     - structure_gel 2.16.2     - takesapillage 1.0.3     - temporalapi 1.6.7     - terrablender 3.0.1.7     - v_slab_compat 1.20-2.4     - villagersplus 3.1     - voidtotem 3.0.1     - waystones 14.1.6     - xaerominimap 24.7.1     - xaeroplus 2.25     - xaeroworldmap 1.39.2     - yungsapi 1.20-Forge-4.0.5     - yungsbridges 1.20-Forge-4.0.3     - zeta 1.0-24 [16Jan2025 00:33:26.258] [main/WARN] [mixin/]: Reference map '' for adapter.init.mixins.json could not be read. If this is a development environment you can ignore this message [16Jan2025 00:33:29.341] [main/INFO] [MixinExtras|Service/]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.4.1). [16Jan2025 00:33:31.153] [main/INFO] [net.minecraft.server.Bootstrap/]: ModernFix reached bootstrap stage (18.33 s after launch) [16Jan2025 00:33:31.418] [main/WARN] [mixin/]: @Final field delegatesByName:Ljava/util/Map; in modernfix-forge.mixins.json:perf.forge_registry_alloc.ForgeRegistryMixin from mod modernfix should be final [16Jan2025 00:33:31.421] [main/WARN] [mixin/]: @Final field delegatesByValue:Ljava/util/Map; in modernfix-forge.mixins.json:perf.forge_registry_alloc.ForgeRegistryMixin from mod modernfix should be final [16Jan2025 00:33:33.921] [main/INFO] [net.minecraft.server.Bootstrap/]: Vanilla bootstrap took 2759 milliseconds [16Jan2025 00:33:38.669] [main/WARN] [mixin/]: Static binding violation: PRIVATE @Overwrite method m_47505_ in modernfix-common.mixins.json:perf.remove_biome_temperature_cache.BiomeMixin from mod modernfix cannot reduce visibiliy of PUBLIC target method, visibility will be upgraded.
    • should the changes apply only to the listed ores, or do you want a more comprehensive overhaul of resource progression?
    • The information provided isn’t quite enough to pinpoint the issue. It would be helpful to know more about your setup. For instance, what screen recording software are you using, and is it set to capture the game window, full screen, or your entire desktop?
    • I had the same issue, so I ended up registering through gmail
    • I am trying to make an attack animation works for this entity, I have followed tutorials on youtube, looked into Geckolib's documentation but I can't find why it isn't working. The walking animation works, the mob recognizes the player and attack them. The model and animations were made in Blockbench.   public class RedSlimeEntity extends TensuraTamableEntity implements IAnimatable { private final AnimationFactory factory = GeckoLibUtil.createFactory(this); private boolean swinging; private long lastAttackTime; public RedSlimeEntity(EntityType<? extends RedSlimeEntity> type, Level worldIn) { super(type, worldIn); this.xpReward = 20; } public static AttributeSupplier.Builder createAttributes() { AttributeSupplier.Builder builder = Mob.createMobAttributes(); builder = builder.add(Attributes.MOVEMENT_SPEED, 0.1); builder = builder.add(Attributes.MAX_HEALTH, 50); builder = builder.add(Attributes.ARMOR, 0); builder = builder.add(Attributes.ATTACK_DAMAGE, 25); builder = builder.add(Attributes.FOLLOW_RANGE, 16); return builder; } public static void init() { } @Override protected void registerGoals() { this.goalSelector.addGoal(3, new FloatGoal(this)); this.goalSelector.addGoal(1, new RedSlimeAttackGoal(this, 1.2D, false)); this.goalSelector.addGoal(4, new WaterAvoidingRandomStrollGoal(this, 1.0D)); this.goalSelector.addGoal(5, new RandomLookAroundGoal(this)); this.goalSelector.addGoal(2, new RedSlimeAttackGoal.StopNearPlayerGoal(this, 1)); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); } private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) { if (event.isMoving()) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.model.walk", true)); return PlayState.CONTINUE; } event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.model.idle", true)); return PlayState.CONTINUE; } private <E extends IAnimatable> PlayState attackPredicate(AnimationEvent<E> event) { if (this.swinging && event.getController().getAnimationState() == AnimationState.Stopped) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.model.attack", false)); this.swinging = false; return PlayState.CONTINUE; } return PlayState.STOP; } @Override public void swing(InteractionHand hand, boolean updateSelf) { super.swing(hand, updateSelf); this.swinging = true; } @Override public void registerControllers(AnimationData data) { data.addAnimationController(new AnimationController<>(this, "controller", 0, this::predicate)); data.addAnimationController(new AnimationController<>(this, "attackController", 0, this::attackPredicate)); } @Override public AnimationFactory getFactory() { return factory; } class RedSlimeAttackGoal extends MeleeAttackGoal { private final RedSlimeEntity entity; public RedSlimeAttackGoal(RedSlimeEntity entity, double speedModifier, boolean longMemory) { super(entity, speedModifier, longMemory); this.entity = entity; if (this.mob.getTarget() != null && this.mob.getTarget().isAlive()) { long currentTime = this.entity.level.getGameTime(); if (!this.entity.swinging && currentTime - this.entity.lastAttackTime > 20) { // 20 ticks = 1 second this.entity.swinging = true; this.entity.lastAttackTime = currentTime; } } } protected double getAttackReach(LivingEntity target) { return this.mob.getBbWidth() * 2.0F * this.mob.getBbWidth() * 2.0F + target.getBbWidth(); } @Override protected void checkAndPerformAttack(LivingEntity target, double distToEnt) { double reach = this.getAttackReach(target); if (distToEnt <= reach && this.getTicksUntilNextAttack() <= 0) { this.resetAttackCooldown(); this.entity.swinging = true; this.mob.doHurtTarget(target); } } public static class StopNearPlayerGoal extends Goal { private final Mob mob; private final double stopDistance; public StopNearPlayerGoal(Mob mob, double stopDistance) { this.mob = mob; this.stopDistance = stopDistance; } @Override public boolean canUse() { Player nearestPlayer = this.mob.level.getNearestPlayer(this.mob, stopDistance); if (nearestPlayer != null) { double distanceSquared = this.mob.distanceToSqr(nearestPlayer); return distanceSquared < (stopDistance * stopDistance); } return false; } @Override public void tick() { // Stop movement this.mob.getNavigation().stop(); } @Override public boolean canContinueToUse() { Player nearestPlayer = this.mob.level.getNearestPlayer(this.mob, stopDistance); if (nearestPlayer != null) { double distanceSquared = this.mob.distanceToSqr(nearestPlayer); return distanceSquared < (stopDistance * stopDistance); } return false; } } @Override public void tick() { super.tick(); if (this.mob.getTarget() != null && this.mob.getTarget().isAlive()) { if (!this.entity.swinging) { this.entity.swinging = true; } } } } @Override public @Nullable AgeableMob getBreedOffspring(ServerLevel serverLevel, AgeableMob ageableMob) { return null; } @Override public int getRemainingPersistentAngerTime() { return 0; } @Override public void setRemainingPersistentAngerTime(int i) { } @Override public @Nullable UUID getPersistentAngerTarget() { return null; } @Override public void setPersistentAngerTarget(@Nullable UUID uuid) { } @Override public void startPersistentAngerTimer() { } protected void playStepSound(BlockPos pos, BlockState blockIn) { this.playSound(SoundEvents.SLIME_SQUISH, 0.15F, 1.0F); } protected SoundEvent getAmbientSound() { return SoundEvents.SLIME_SQUISH; } protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return SoundEvents.SLIME_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.SLIME_DEATH; } protected float getSoundVolume() { return 0.2F; } }  
  • Topics

×
×
  • Create New...

Important Information

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