Use ItemMonsterPlacer.getEntityName to get the entity registry name of a spawn egg.
Don't modify the spawner TileEntity in NBT, use MobSpawnerBaseLogic#setEntityName.
Don't call World#removeTileEntity yourself, Minecraft will call it when necessary.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Edit: The method isn't public static it's only public so the method .get method won't work. Do I need java reflection since it's not a static method or is there a simpler way?
this is for 1.7.10 code manually doing this myself. .getEntityName doesn't exist in the class itself. I controlled f and searched the method. Did you mean getItemStackDisplayName in the class
Why should I use mobspawnerbase logic doesn't that only work if the global id exists? I want my mod to work with forge mobs. I thought you wanted me to remove the tile entity if I was replacing it with another one. My code would only works if the item is apple in the future it will be item egg spawn. If you have a reasonable reason for me not to override vanilla I will change my code.
The current method you gave me will work for all spawn eggs if they have a global id which all spawn eggs have. I am manually making my forge spawn eggs for mobs that don't have a global id along with their own spawner instances like nei if possible. These spawners however will have a shiny forge spawner texture.
In 1.7.10, the spawn egg's metadata is used to represent the entity's global ID. Use EntityList.getStringFromID to get the registry name corresponding to a global ID.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Yeah I was thinking that in the first place but, the method said display name so I hesitated Thinking text display can be different then the mob ids.
How do I force kill the entity upon my click block event handler? It still spawns in the mob and clears the item if in survival. I want the item cleared however I don't want the entity spawning in.
How do I force kill the entity upon my click block event handler? It still spawns in the mob and clears the item if in survival. I want the item cleared however I don't want the entity spawning in.
Cancel the event (Event#setCanceled) after you change the mob spawner's entity. This will prevent the Block and Item responding to the right click, so the entity won't be spawned by the egg.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
That worked. I was able to manually remove 1 item from itemstack each right click if player isn't in creative.
In order to fix the xp problem that has been annoying me I need to manually kill or despawn them as soon as they spawn in upon block break and or harvest drop event. How do I do this?
In order to fix the xp problem that has been annoying me I need to manually kill or despawn them as soon as they spawn in upon block break and or harvest drop event. How do I do this?
Set your BreakEvent handler's priority to EventPriority.LOWEST, then store the position and XP (BreakEvent#getExpToDrop) of the broken block.
Subscribe to EntityJoinWorldEvent and check if the entity is an instance of EntityXPOrb, its position is the block's position plus 0.5 on each axis and the stored XP minus the orb's XP (EntityXPOrb#xpValue) is >= 0. If this is true, subtract the orb's XP from the stored XP and cancel the event.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Get xp to drop. It states that it is 0. This is why I said I needed to manually kill them. I don't think it can be an instance of block except for the block cords within xp's spawning range. Other then that I can't use .getxptodrop as divinerpg, aoa and essence of the gods mod spawn the xp in manually. Also I reread this and will this disable all xp for the second part or just the block that I want? I guess I could check if event.block == GameRegistry.findblock("something","something")
Get xp to drop. It states that it is 0. This is why I said I needed to manually kill them.
I don't know why the method isn't working for you, it works without issue for me in 1.7.10 and 1.10.2.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I think it's because, they all have event handlers doing this for them and or proxies. Will the other method work still Without this Maybe scanning this to a block and how would I tie this to block break? However according to dizzlepop contradictory statement it's dropblockasitemwithchance and then it has xp 15 + next rand 15 + next rand 15. For essence of the gods 1.8.9 (Journey into the light) each spawner is created from their spawner class which has that method in it. Is there another method to just kill entities upon block break?
You said it worked for you on 1.7.10 and l.10.2? Did you test this with aoa or divinerpg? You can experiment with this. Make sure to only register this if divinerpg is loaded. I know this is the right code for finding the block because, it drops the block. Eternal doom said the xp issue spawning them in manually will be fixed in the next update however, aoa and essence of the gods mod won't seem to comply.
I did test this to see if it disabled other mods worked with disabling xp and both vanilla redstone(had to be lit) blocks and modded blocks and it worked for both of them.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
If the mods aren't using the proper hooks, that makes things more difficult.
It's easy enough to cancel the spawn of an XP orb with EntityJoinWorldEvent, but the tricky part is knowing which orbs to cancel. You need to know when to start cancelling XP spawns (e.g. an event fired before the XP is spawned) and when to stop (e.g. an event fired after the XP is spawned or a counter to keep track of how much XP was supposed to be spawned and how much you've cancelled).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
what about the /kill all command doesn't that kill all entities within a certain radius? Could I do something like that? I think the radius should be within 3 blocks (each direction just to make sure). This could be on the block break event and / or harvest drops event. So I could be killing them immediately as soon as they spawn in.
I am learning towards letting them spawn in however killing them before the player could even grab them because, the event wouldn't have finished? Is this possible or does it spawn xp after the event has happened. Is there an event immediately after the event to kill the orbs or would this be called harvest drops event.
I don't know when these mods spawn their XP in relation to the Forge events, you'll have to figure that out yourself.
Use World#getEntitiesWithinAABB to get all entities of the specified type in the specified bounding box.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The first parameter is getting the entity then int. I got the int of 3. Where is xp orbs located I had tried net.minecraft.entity package and it wasn't their. Now after I get the bounding box how do I kill those entities in the bounding box? Do I set that to a varible then take that and applie it to the kill code. I don't know how to kill the entities in the bounding box nor kill entities under the event. So bounding box is 3 radius does that means it is +3 xyz. Also My event handler wanted me to apply eventDivineRPG.world.getCollidingBoundingBoxes(Entity, 3); . Will this still do the job?
I didn't say anything about World#getCollidingBoundingBoxes, you don't need to use that here.
You need to create an AABB with the block's coordinates as the minimum coordinates and the same coordinates plus 1 as the maximum coordinates, then expand it by 3 in each direction using the AxisAlignedBB#expand method.
You then need to call World#getEntitiesWithinAABB with EntityXPOrb.class and the AABB you created.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Now once I got the entities in the bounding box do I set this to the variable? I don't think I should. Under the event entity .setdead isn't an option in the bounding box (varboundingbox) or event.world.
Yes, that's how you create an AABB in 1.7.10. In newer versions, you use the constructor directly instead.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
.setdead isn't an option in the bounding box (varboundingbox) or event.world. So how should I set them dead. Or is it called something else. Entity.setdead() must not be static?
Use ItemMonsterPlacer.getEntityName to get the entity registry name of a spawn egg.
Don't modify the spawner TileEntity in NBT, use MobSpawnerBaseLogic#setEntityName.
Don't call World#removeTileEntity yourself, Minecraft will call it when necessary.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Edit: The method isn't public static it's only public so the method .get method won't work. Do I need java reflection since it's not a static method or is there a simpler way?
this is for 1.7.10 code manually doing this myself. .getEntityName doesn't exist in the class itself. I controlled f and searched the method. Did you mean getItemStackDisplayName in the class
Why should I use mobspawnerbase logic doesn't that only work if the global id exists? I want my mod to work with forge mobs. I thought you wanted me to remove the tile entity if I was replacing it with another one. My code would only works if the item is apple in the future it will be item egg spawn. If you have a reasonable reason for me not to override vanilla I will change my code.
The current method you gave me will work for all spawn eggs if they have a global id which all spawn eggs have. I am manually making my forge spawn eggs for mobs that don't have a global id along with their own spawner instances like nei if possible. These spawners however will have a shiny forge spawner texture.
In 1.7.10, the spawn egg's metadata is used to represent the entity's global ID. Use EntityList.getStringFromID to get the registry name corresponding to a global ID.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Yeah I was thinking that in the first place but, the method said display name so I hesitated Thinking text display can be different then the mob ids.
How do I force kill the entity upon my click block event handler? It still spawns in the mob and clears the item if in survival. I want the item cleared however I don't want the entity spawning in.
Cancel the event (Event#setCanceled) after you change the mob spawner's entity. This will prevent the Block and Item responding to the right click, so the entity won't be spawned by the egg.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
That worked. I was able to manually remove 1 item from itemstack each right click if player isn't in creative.
In order to fix the xp problem that has been annoying me I need to manually kill or despawn them as soon as they spawn in upon block break and or harvest drop event. How do I do this?
Set your BreakEvent handler's priority to EventPriority.LOWEST, then store the position and XP (BreakEvent#getExpToDrop) of the broken block.
Subscribe to EntityJoinWorldEvent and check if the entity is an instance of EntityXPOrb, its position is the block's position plus 0.5 on each axis and the stored XP minus the orb's XP (EntityXPOrb#xpValue) is >= 0. If this is true, subtract the orb's XP from the stored XP and cancel the event.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Get xp to drop. It states that it is 0. This is why I said I needed to manually kill them. I don't think it can be an instance of block except for the block cords within xp's spawning range. Other then that I can't use .getxptodrop as divinerpg, aoa and essence of the gods mod spawn the xp in manually. Also I reread this and will this disable all xp for the second part or just the block that I want? I guess I could check if event.block == GameRegistry.findblock("something","something")
I don't know why the method isn't working for you, it works without issue for me in 1.7.10 and 1.10.2.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I think it's because, they all have event handlers doing this for them and or proxies. Will the other method work still Without this Maybe scanning this to a block and how would I tie this to block break? However according to dizzlepop contradictory statement it's dropblockasitemwithchance and then it has xp 15 + next rand 15 + next rand 15. For essence of the gods 1.8.9 (Journey into the light) each spawner is created from their spawner class which has that method in it. Is there another method to just kill entities upon block break?
You said it worked for you on 1.7.10 and l.10.2? Did you test this with aoa or divinerpg? You can experiment with this. Make sure to only register this if divinerpg is loaded. I know this is the right code for finding the block because, it drops the block. Eternal doom said the xp issue spawning them in manually will be fixed in the next update however, aoa and essence of the gods mod won't seem to comply.
I did test this to see if it disabled other mods worked with disabling xp and both vanilla redstone(had to be lit) blocks and modded blocks and it worked for both of them.
So I think this is what the other mods might be doing.
I can't help you any more with the XP.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
All I asked was if the playerjoinworld event would work without .getxp method. I will take this to eternal doom.
If the mods aren't using the proper hooks, that makes things more difficult.
It's easy enough to cancel the spawn of an XP orb with EntityJoinWorldEvent, but the tricky part is knowing which orbs to cancel. You need to know when to start cancelling XP spawns (e.g. an event fired before the XP is spawned) and when to stop (e.g. an event fired after the XP is spawned or a counter to keep track of how much XP was supposed to be spawned and how much you've cancelled).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
what about the /kill all command doesn't that kill all entities within a certain radius? Could I do something like that? I think the radius should be within 3 blocks (each direction just to make sure). This could be on the block break event and / or harvest drops event. So I could be killing them immediately as soon as they spawn in.
I am learning towards letting them spawn in however killing them before the player could even grab them because, the event wouldn't have finished? Is this possible or does it spawn xp after the event has happened. Is there an event immediately after the event to kill the orbs or would this be called harvest drops event.
I don't know when these mods spawn their XP in relation to the Forge events, you'll have to figure that out yourself.
Use World#getEntitiesWithinAABB to get all entities of the specified type in the specified bounding box.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The first parameter is getting the entity then int. I got the int of 3. Where is xp orbs located I had tried net.minecraft.entity package and it wasn't their. Now after I get the bounding box how do I kill those entities in the bounding box? Do I set that to a varible then take that and applie it to the kill code. I don't know how to kill the entities in the bounding box nor kill entities under the event. So bounding box is 3 radius does that means it is +3 xyz. Also My event handler wanted me to apply eventDivineRPG.world.getCollidingBoundingBoxes(Entity, 3); . Will this still do the job?
I didn't say anything about World#getCollidingBoundingBoxes, you don't need to use that here.
You need to create an AABB with the block's coordinates as the minimum coordinates and the same coordinates plus 1 as the maximum coordinates, then expand it by 3 in each direction using the AxisAlignedBB#expand method.
You then need to call World#getEntitiesWithinAABB with EntityXPOrb.class and the AABB you created.
Use Entity#setDead to kill the XP orbs.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Is this creating a bounding box?
http://pastebin.com/hy7F83qY
Now once I got the entities in the bounding box do I set this to the variable? I don't think I should. Under the event entity .setdead isn't an option in the bounding box (varboundingbox) or event.world.
Yes, that's how you create an AABB in 1.7.10. In newer versions, you use the constructor directly instead.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
.setdead isn't an option in the bounding box (varboundingbox) or event.world. So how should I set them dead. Or is it called something else. Entity.setdead() must not be static?