-
Posts
1773 -
Joined
-
Last visited
-
Days Won
61
Everything posted by V0idWa1k3r
-
{Solved} Right click action going through twice
V0idWa1k3r replied to BigSpidey's topic in Modder Support
You are confusing this method with the right click event. The event will indeed fire for both hands. The Item#onItemRightClick will only fire for the hand holding the item. You can't do this without first checking whether the side the action is happening on is a server. Otherwise it will create a "ghost" entity on the client that will stay there untill relog. As @Daeruin said Same with this, you need to check the side. Otherwise you are sending the message twice. -
Why is player name and player UUID changing every time I run my mod?
V0idWa1k3r replied to MrChoke's topic in Modder Support
I was just clarifying this point of yours These are independent of which player you are since these are stored in the level.dat file. -
Define "send a message". Send it to a server for everyone to see? Or display it for the player who clicks on the block? If it's the former use PlayerList#sendMessage. If it's the latter use Entity#sendMessage
- 1 reply
-
- 1
-
Why is player name and player UUID changing every time I run my mod?
V0idWa1k3r replied to MrChoke's topic in Modder Support
These are in no way related to UUIDs in single player which is where you will spend most of your time modding. Player data is stored within the level.dat file and that includes the capabilities. However when you are modding for multiplayer you also might want the UUID to be random to generate random players to join them all to a server. In general I see little point in keeping the player login data consistent. It doesn't matter in single player and you want different players for multiplayer. There are however cases when you need to store something about the player by the UUID - say their relationship points with villagers - those would be stored in a map<UUID, Integer> in the entity. But these edge cases are far and between. -
How to modify vanilla ore generation in 1.12.2?
V0idWa1k3r replied to Jiro7's topic in Modder Support
https://mcforge.readthedocs.io/en/latest/events/intro/ Any class/object can be an event handler. There are no restrictions as far as I am aware. -
How to modify vanilla ore generation in 1.12.2?
V0idWa1k3r replied to Jiro7's topic in Modder Support
Disable their generation and run your generation instead. To disable the generation of a specific ore handle the GenerateMinable event, check if the EventType is the one you want to disable and set the result to DENY. It is absolutely possible but depends on the generation method. You could stop the vanilla's iron ore generation and replace it with your own one that generates the ore and maybe generates the rare ore. If for some reason you can't do that(for example you need to generate your ore in the ore of an another mod that doesn't throw any events) you will have to scan the chunk for the ores to generate your stuff in. -
# is just a way of writing method reference in the javadocs. When I say ClassName#methodName I mean invoke the method "methodName" using an instance of class "ClassName". If the method was static I would use a dot instead of #(ClassName.methodName)
-
Check that the current element the event had fired for is the one you want to render your stuff after. You can get the current element from RenderGameOverlayEvent#getType
-
Don't remove the original question from your post. If the issue has been resolved but you have a new one just leave a new reply. Now if someone else has the BOM character issue they won't be able to find a solution by searching the forums since you have changed the title and removed the question. Are you sure the event is being handled? As in how did you register the event handler to the bus? Why? This fires multiple times for various HUD elements. You need to check the current element and only draw your text once per frame instead of once per element.
-
As far as I am aware that is a BOM(Byte Order Mark) character issue. Open your file in a text editor that allows you to change the encoding, such as Notepad++ and change the encoding to UTF-8 without BOM(obviously override the file after you've done that).
-
https://mcforge.readthedocs.io/en/latest/blocks/states/ https://mcforge.readthedocs.io/en/latest/models/blockstates/introduction/
-
I just listed the things that you need to do. If you need an example start with something simple, like a hay block(BlockHay). I am not going to write code for you, that won't help you.
-
It is possible to attack up to the block reach distance in creative mode. Which is 6 blocks. 1.7.10 is no longer supported on these forums.
-
Well, did you look at what the anvil does to acheive that? You need a direction property registered in your BlockStateContainer, you need it serialized and deserialized from metadata and you need to set that property in your blockstate container to a value when the block is placed. Oh and you also need to define the values of that property in your blockstate file and rotate it accordingly.
-
IHasModel is stupid. All items need models and there is nothing about a model registration that requires access to protected/private methods of the item. Register your models in the ModelRegistryEvent directly. Cool. What exactly are you trying to do? Define "work on". Because I can't tell your intentions by looking at your code since it does nothing. Block doesn't have a onItemUse method. Item does. Unless you are calling it from somewhere this method does nothing.
-
Because the player's reach is 5 blocks and this method allows anything within less than 6 blocks to be attacked. The combat will break completely because the player won't be able to attack anything that isn't extremely close to them. And it won't prevent the "kill aura" anyway. As a side note - what version of the game are you talking about? This method is different in the latest version. In fact since it doesn't check the thread the packet is received on I suspect this is 1.7 or earlier but I might be incorrect.
-
Don't have empty variants. It isn't supposed to be empty anyway - if the X axis is the default one and the Z is rotated by 90 degrees on the Y axis then the Y variant should be rotated by 90 degrees on either X or Z axis. Here is my example of using a blockstate with rotation. This actually means that your block doesn't have the rotation property at all, since if it had a property that wasn't specified in it's blockstate file it would have a missing model since it's blockstate file is invalid. Either you are not relaying the correct information or you don't have the property in your BlockStateContainer. Show it anyway, you have some conflicting information here.
-
This task only selects the nearest entity matching the predicate as a target. It doesn't actually make the entity move to the target or even attack it. You need to add those other tasks too.
-
You can't do this in the entity constructor since models are client-side and this will crash the server. EntityCreature doesn't have ATTACK_DAMAGE registered at all, hence the NPE when getting it. You need to register the attribute first with AbstractAttributeMap#registerAttribute. See EntityMob for an example.
-
public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, net.minecraft.client.model.ModelBiped _default) The custom model for the armor must be an instance of ModelBiped. Unless you want to invent a way to convert a IBakedModel into a ModelBiped this is impossible with this method. Even if you go around this method and use events to render a IBakedModel you will have a nightmare trying to animate parts of it(you can't split the model into parts because the item needs to be a single model obviously and armor parts are rotated differently).
-
Custom Crafting recipes MInecraft Problem
V0idWa1k3r replied to RocaTeithmore's topic in Modder Support
You need to specify all of those variants in the ingredient. Or if you want stuff from other mods to be accepted as well you'd need to use the ore dictionary. Here is an example of using ore dict(I specify stuff in the _constants file but you can specify them directly in your ingredients, having a _constants just allows you to reuse ingredients instead of having to type them over and over again) The recipes use json. the "data" is just a json property of the object named after your ingredient key. -
You would need to make an identical model in json/obj and make the item have that model just as any other item. And before you ask - yes, there is a way to reuse your ModelBiped code and no, I won't be supporting it or explaining it as it is not the use case for it. Make a model for your item in something like BlockBench and export it to both json(item model) and java(armor model).
-
You can specify an alpha test function that would cut off pixels that are too transparent. GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); This is not the blend function the vignette uses but I guess if it works for your texture just fine then you can keep it... Change the Z level to something big and negative. You can also remove the depth manipulations while you are at it. And change the event to Post instead of Pre. Also an important note - Pre and Post events fire for each HUD element! That means that you are rendering your overlay multiple times over and over again. You need to check the current element being rendered. In your case it would be ALL. if (event.getType() == RenderGameOverlayEvent.ElementType.ALL)
-
It is easier to list objects that ARE singletons. As a rule of thumb anything that is a IForgeRegistryEntry is a singleton.
-
Custom Crafting recipes MInecraft Problem
V0idWa1k3r replied to RocaTeithmore's topic in Modder Support
No it isn't. / is as valid of a character as any other one in java. \ is the escape character. It can't work just fine because it's syntax is invalid. Stone has subtypes and uses metadata to differentiate between variants and as such a data property must be specified in the ingredient. You are not specifying one.