• 0

    posted a message on Making an Entity Immune to arrow attacks?!

    you already have all the code you need.


    just check if the entity is an instance of EnttiyPlayer, if this is the case, check if the player's current held itemstack is not null and is an instance of ItemSword.

    Posted in: Modification Development
  • 1

    posted a message on [Unsolved] Rendering Projectiles in 1.8

    Yes this should work, if not it might also be your projectile entity.

    What you can do is override the entitysnowball renderer.


    Instead of registering your entity class to the RenderingRegistry, you can replace it with the entitysnowball class.

    Now when you spawn a snowball entity, it will take the overridden render instance.


    If you know how to use tessellator and worldrenderer, you could draw a rectangle instead of using ItemStack#renderItemModel. This is what used to be used in 1.7, but because you can edit the json files you could potentially create a 3d snowball model so the renderer now takes the same model as the item.

    Posted in: Modification Development
  • 1

    posted a message on [Unsolved] Rendering Projectiles in 1.8

    I have spotted some serious error in your project.

    1) any character in the name of your package should be lower-cased and unique at all times. here is an exampleon how to use packages according to java naming conventions.

    2) you seem to not make use of your root namespace/package for other packages. The 'entities' package does not exist within your rootpackage 'SolarSystem' (which should become [domain].solarsystem). This is a huge flag for when you compile your project to a jar file.


    Lets say I have created a similar mod, with the same package name and created a class which happens to have the same name as well. When the projects are loaded, a fully qualified name collision will occur. What I would suggest you to do is to refactor your other packages to be part of the root package. When you use a domain or organisation as prefix for your package, you are 99% ensured for uniqueness of your fully qualified names.


    Now onto the problem of your rendering. You do not return any desired texture for your rendered entity, you are returning a location to the spritesheet of the block textures (TextureMap#locationBlocksTexture). Really simple, just replace this resourcelocation with the resourcelocation pointing to the desired image in your assets folder [sourcefolder(default: /src/main/resources)]/assets/your/texture/location.


    private static final ResourceLocation texture = new ResourceLocation("modid", "your/texture/location/texturefile.png");


    note, this render class uses the same model renderer as your item, it takes all the same data as the .json files for your item. So if anything else could be wrong when rendering the entity, it should be your .json file. You could use Items.snowball as argument of your render class as well, it will take the .json file from the snowball item instead.

    Posted in: Modification Development
  • 0

    posted a message on Level Requirement Mod - Or Update
    Quote from Clone82»

    I couldn't thank you more! Works perfectly, and even better by not throwing it onto the ground. Works with bows, and everything! Like I said, if you ever want on the server just ask.

    And if it's not too much, I have another smaller request in the same field. Just a simple command something like '/unbreak' which gives the selected item the unbreakable NBT tag. It's easy enough to nbtedit the item in-game and add the tag myself, but a command to do it much quicker would be amazing.

    If not it's fine, I appreciate what you've done so much! Thank you!



    Bit delayed, had to go out to get something to eat.

    I am curious on what you do with this little mod though, it is not a problem to add the additional unbreaking command.

    public:
    /help lr // seemed to crash before
    /lr help // correctly display all commands


    authorized:

    /lr <integer> // set item level restriction
    /lr unbreakable // adds the `Unbreakable` tag
    /lr remove [ level | unbreakable ] // remove unbreakable or level separately.

    has auto tab-completion.

    download link

    Posted in: Requests / Ideas For Mods
  • 1

    posted a message on Level Requirement Mod - Or Update

    I have made simple port for you.


    It works a bit different, it prevents the player from using (e.g. sheering, blocking, filling a bucket), left clicking (e.g. attacking, mining) or harvesting a block with the selected item when the level requirement is not met instead of dropping the item on the floor.

    The restriction is only for non-creative players.


    People who can use the command have to be added to the config file, optionally you edit some of the display messages.

    download link.


    build on mc 1.7.10, MinecraftForge 10.13.2.1291.

    commands:

    /lr <integer> // set the level of the item

    /lr check // prints the level of the item

    /lr help // shows the command


    Sample screenshots:


    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on Mob model parts as one

    Why wouldn't it be possible?


    A rough example: you could take a look at is the EntityDragon class. This entity consists of an array of child entities. Those entities are initialized and have a position relative to the enderdragon but are infact not spawned in the world. The way mojang managed to detect collision on the parts is cheaty but smart without having to rewrite the axis aligned bounding box.


    The bounding box of the dragon it self covers the whole entity, but it is not the bouding box that is used for checking if the entity was hit.


    I don't have the source on me, but I do remember the onUpdate/onLivingUpdate method in the dragon entity class iterates over all the child entities which check set there position relative to the rotation and position of the parent and checks if one of the child entities was hit.


    I have made a post, on a similar thread, with code examples you might want to take a look at that.

    http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1437236-several-players-mounting-one-entity

    Posted in: Modification Development
  • 0

    posted a message on A bot using an inventory GUI

    I haven't got a single clue on what you're trying to achieve here, but couldn't you just loop through the itemstacks in the inventory?

    Either iterate over all the itemstacks or get the inventory slot length and check each slot containing an itemstack for your particular enchantment.


    Or does the 'bot' have to open the inventory in such a way the player sees the inventory is opened?(- if that makes sense)

    Posted in: Modification Development
  • 0

    posted a message on Override default pick-up sound

    There is one way of doing it that I know of.


    Cancel the pickup sound in either PlaySoundSourceEvent or PlaySoundAtEntityEvent so it won't play at all. And in the EntityItemPickupEvent or PlayerEvent.ItemPickupEvent event you can play a sound at the entity. If the items belong to your mod, play your sound and if the items aren't play the default pickup sound.

    Posted in: Modification Development
  • 0

    posted a message on Render with custom player renderer

    So, is your error solved now or do you still need help on something?

    Posted in: Modification Development
  • 0

    posted a message on Render with custom player renderer

    something is null at kirbyandfriends.OverridePlayer.onRenderPlayerPre(OverridePlayer.java:42), which would be the EntityPlayer object you created, but not initialized. You have commented out that line, did you commented out this line after getting the error? And why would you want to create a global player object in your class if you're already checking if rendered entity is an instance of EntityPlayer?


    If "//modelDee.render(player, 0.0F, 0.0F, 0.0F,0.0F 0.0625F);" is not line 42, can you post which line is?

    Posted in: Modification Development
  • 0

    posted a message on Check if item is in hotbar?

    Here is a list of events with a brief description of when it fires, the one that fits your needs at best would be the tickevent, and maybe the playertick only.

    Posted in: Modification Development
  • 0

    posted a message on Render with custom player renderer

    This will change all the player renderers at the same time when the item is right clicked, I don't think that this is what you are looking for (you're making everything static).


    I would suggest to create an extended property class which is bound to the player. There are actually are some good tutorials on how to register, save and load such extended property class for entities.


    When you've created an ExtendedProperty class, you should add a variable which can hold the name of the desired model.

    Upon right-clicking said item, set the name of the model that you want to render in that ExtendedProperty object which is bound to a player to the variable you've just created and we'll use this variable to render the requested model.


    In your player render event callback, you would have to check if the there exactly is an ExtendedProperty which is bound to the player. If there is an existing ExtendedProperty object that is also an instance of your ExtendedProperty class, you can take the name of the model which has to be loaded and pass that to your RenderLiving. This way all players have their own player model when they right click your item.


    And again, there are some in depth tutorials on extendedproperties. I've only used them when they were at first introduced, so I can't help you on that topic (fixing errors are fine, just not 'extendedproperties not working').

    Posted in: Modification Development
  • 0

    posted a message on Check if item is in hotbar?
    Quote from wormeater»



    Now, my only remaining question, what would the best event be to hook this into? In the grand scheme of things, I want it to have a chance to cause effects if in your hotbar or on you armor, but not just in your hand. I am currently hooked into playerevent.itempickedup, which would activate the timer to get a chance for a effect once I implement that. How can I make it so that whenever they move the item to there hotbar, the timer to roll for effects begins immediately, rather than waiting for the player to pick up an item to start it?


    Could you perhaps reformat your question? It might sound logical in your head, but I can't picture what you're trying to accomplish.
    Posted in: Modification Development
  • 0

    posted a message on Render with custom player renderer
    Quote from BearOfDoom»

    can you describe in a teeny bit more of a walkthrough sense please? I think I understand where its going but im not sure. What we want to do is change the player model through a item and change it though.

    No offense, but I can't make a clear description about what you're trying to ask from this post.

    Maybe it's for the best if you create a separate thread about what you want to accomplish instead.
    Posted in: Modification Development
  • 0

    posted a message on Check if item is in hotbar?

    for the hotbar, you can make a list of itemstacks from the inventory or loop through all itemstacks like so:


    InventoryPlayer inventory = player.inventory;

    for (int i = 0; i < inventory.getHotbarSize(); i++) {
    ItemStack itemStack = inventory.mainInventory;
    // enchantment checks here
    }



    Posted in: Modification Development
  • To post a comment, please or register a new account.