• 0

    posted a message on [SOLVED]Help with cooldown on event
    Quote from kiingz8»

    it works perfectly! :D


    Thank you so much for the help, I've been looking everywhere for a solution but I was only finding a solution for bukkit/spigot


    No problem, glad I could be of help!

    Posted in: Modification Development
  • 1

    posted a message on [SOLVED]Help with cooldown on event

    You can add a cooldown to an item by via the CooldownTracker like this:

    player.getCooldownTracker().setCooldown(your item, cooldown duration in ticks);

    Also, since the wolfblood sword is your custom item, I recommend overriding your items onItemRightClick() instead of using the RightClickItem event. You can check out the EnderPearlItem to see how vanilla does it.


    Hope this helps!

    Posted in: Modification Development
  • 0

    posted a message on How to summon a TNT without using cheats?

    I suggest taking a look at the TNTBlock to see how vanilla does it.

    Posted in: Modification Development
  • 0

    posted a message on issues with 3D armor model coding
    Quote from protnore1»

    I have played with different texture map sizes, sectioned them by colors to see what is being affected but by the looks of it the entire texture map is being sucked in by modelBiped, is there a way I can constrict modelBiped to just look for textures in a specific 64 x 32 area that has no textures in it instead of the entire texture map?


    I am honestly not sure what the best approach is. You could perhaps try and go through every ModelRenderer that is inherited from ModelBiped (so bipedHead, bipedBody, etc) and empty their cubeList, to hopefully avoid rendering the ModelBiped completely. Then you should be able to put your texture anywhere in the 128x128 area.

    Posted in: Modification Development
  • 0

    posted a message on issues with 3D armor model coding

    Regarding the override, I was thinking something like this:


    @Override
    public void setRotationAngles(parameters here) {
    if (!(supplied_entity instanceof ArmorStand)) {
    super.setRotationAngles(parameters here);
    }
    }

    You would have to check the source code of ModelBiped to see the exact method name and parameter list.


    As for the texture problem, I think I know that the problem is. There is actually a block for the texture to sit on, namely the original bipedHead. You would have to leave the top left 64x64 pixels in the texture empty, otherwise the original ModelBiped cubes screw things up. If this is not the source of the problem, then I am afraid I am out of suggestions.

    Posted in: Modification Development
  • 0

    posted a message on issues with 3D armor model coding

    Regarding the armor stand problem - perhaps you could override the setLivingAnimations() and setRotationAngles() methods in the model class and check if the supplied entity is not an armor stand before calling the super method?


    As for your texture problem, I am not sure I fully understand the problem, perhaps you could clarify it even more?

    Posted in: Modification Development
  • 0

    posted a message on issues with 3D armor model coding

    After taking another look, I see now that in your model class you add the RightShoulder and LeftShoulder as children both to Chainmail and the bipedArms. This means that they are renderer twice. Remove these two lines:

    Chainmail.addChild(RightShoulder);

    Chainmail.addChild(LeftShoulder);


    Now you should be left with the floating shoulders that animate correctly. You will have to reposition them by tweaking these lines:

    LeftShoulder.setRotationPoint(4.0F, -9.0F, -1.0F);

    Chainmail.setRotationPoint(4.0F, 12.0F, 2.0F);

    Posted in: Modification Development
  • 0

    posted a message on issues with 3D armor model coding

    Here is what I would try as a first step: In the method getArmorModel() in the DragonArmorBase class, try changing the showModel statements to use your custom ModelRenderers (such as LeftShoulderSpike etc) instead of the inherited ModelRenderers from ModelBiped.

    Posted in: Modification Development
  • 0

    posted a message on Silencing all sounds except the "player getting attacked" ones of other players'
    Quote from wild_lion_043»

    Honestly, I still don't know what to do? I couldn't find anywhere online that gives me info on how to use the PlaySoundEvent.


    What step are you stuck on? Did you look at the source code like I suggested? What have you tried?

    Posted in: Modification Development
  • 0

    posted a message on Radio block or record.
    Quote from inkintx»

    1.7.10, I don't like the newer versions. I'm also using the old launcher because its easier for me to use.


    Hmm, then I am afraid I can't really help you, I have never done mod development on the older versions. Hopefully someone else will be able to chime in.

    Posted in: Modification Development
  • 0

    posted a message on Radio block or record.
    Quote from inkintx»

    I was wondering if it was possible to make a block so that when it's clicked on it loops a recording until it is clicked on again. If so, how could i do that?

    I also was wondering how i could make a custom music disk.

    Thanks


    Of course it can be done! What you want sound similar to the jukebox, so I would recommend looking at that!


    As for a custom music disk, simply register your SoundEvent, and then register a new MusicDiscItem with that SoundEvent.


    Btw, what version are you using? (the above assumes post-1.12, but the approach should be similar for other versions as well)

    Posted in: Modification Development
  • 0

    posted a message on Help with getting data from capability on client side
    Quote from Kiaric»

    I see! For some reason I had it stuck in my head that accessing the capability directly from the client side was a no-no but I guess there's a client version and a server version.

    I think that's everything cleared up.

    Thanks very much for all the help!


    No problem, glad I could help!

    Posted in: Modification Development
  • 0

    posted a message on Help with getting data from capability on client side

    You can access the client player via Minecraft.getMinecraft().player, and from there update the capability.

    Posted in: Modification Development
  • 0

    posted a message on Silencing all sounds except the "player getting attacked" ones of other players'
    Quote from wild_lion_043»

    How would I make it so it only affects certain entities such as other players?


    I recommend taking a look at the PlaySoundEvent class and the ISound interface to get an idea of what you can use to achieve what you want.

    Posted in: Modification Development
  • 0

    posted a message on Silencing all sounds except the "player getting attacked" ones of other players'
    Quote from wild_lion_043»

    What do you mean by that. Sorry. I am still a novice when it comes to this, so could you provide code as to show what you mean.


    It's quite simple, really. This code would silence every sound:

    @EventBusSubscriber(modid = your mod id here)
    public class ForgeEventSubscriber {
    	
    	@SubscribeEvent
    	public static void cancelSound(PlaySoundEvent event) {
    		event.setResultSound(null);
    	}
    
    }
    Posted in: Modification Development
  • To post a comment, please or register a new account.