Make sure you use single quotes (') or escape the double quotes (") (can't remember how to escape at this second) if you put it on one line for using directly in your function, otherwise, the double quotes will cause errors.
Ok, this may be a silly question, but I've looked through the thread and haven't been able to find a solution. So I guess I'll just ask.
...How do you make a door in Custom Stuff 2? There's plenty of stuff about how to do it with the original version, but nothing since the update, as far as I can find, and that unfortunately includes the wiki. Just a basic rundown of the door itself, and the item dropped by it would be fantastic.
Thank you for correcting the shift click and I am getting used to using the 1 page load up. (I just think of it as "warming up" each page) I can get things to stay after placing them twice.( not a big deal). My only actual problem is, no matter how I work it, any item placed on page 4 or 5 ends up on page one when I return to the world after saving and playing another world or come back to the game the next day. Any suggestions on this quirk? If it doesn't get repaired, not that big a deal. I can simply play it as being a 3 page chest, Still way cooler than a big wad of chests in the room. lol And thanks for the quick response on the previous post :-)
...How do you make a door in Custom Stuff 2? There's plenty of stuff about how to do it with the original version, but nothing since the update, as far as I can find, and that unfortunately includes the wiki. Just a basic rundown of the door itself, and the item dropped by it would be fantastic.
I'll give you the short version since I'm somewhat limited on time.
The same basic premise of the door can be drawn from CS1: it's a two-part piece that has both a block and an item as components. As such, you'll need to make both in order to use it, and most of the same basic rules apply.
The door block should always drop the door item when broken. Also, only the textureIndexYP[0] and textureIndexYN[0] are used for texturing, being the top and bottom halves of the door respectively.
For the item, you'll need to include a line that indicates that it's supposed to place the door. Here's an example:
doorId = config.getBlockId("exampleDoorBlockID");
If you're in the bad practice of hard-coding your block and item IDs, you can also just put the number you've assigned to the door block instead of the config.getBlockId stuff.
Finally, when adding these two things to the mod.js, you'll need to declare them both doors rather than normal types like so:
I hope that helped you. If you get it working, consider updating the wiki article as a way of saying thanks. If that didn't help you... please feel free to ask for help.
I'll give you the short version since I'm somewhat limited on time.
The same basic premise of the door can be drawn from CS1: it's a two-part piece that has both a block and an item as components. As such, you'll need to make both in order to use it, and most of the same basic rules apply.
The door block should always drop the door item when broken. Also, only the textureIndexYP[0] and textureIndexYN[0] are used for texturing, being the top and bottom halves of the door respectively.
For the item, you'll need to include a line that indicates that it's supposed to place the door. Here's an example:
doorId = config.getBlockId("exampleDoorBlockID");
If you're in the bad practice of hard-coding your block and item IDs, you can also just put the number you've assigned to the door block instead of the config.getBlockId stuff.
Finally, when adding these two things to the mod.js, you'll need to declare them both doors rather than normal types like so:
I hope that helped you. If you get it working, consider updating the wiki article as a way of saying thanks. If that didn't help you... please feel free to ask for help.
Welp, that certainly did help. Looks like I had gotten the majority of that down already from trial and error, I had just forgotten to add the actual door itself as a block, hence why it kept on crashing when I tried to place the item. Huh. Well, that's one more thing down. Now to keep slogging through adding textures and blocks so I may finally finish my project! Thanks for the help, too!
As for the wiki, I'll look into editing it, but I've never done any wiki editing before, so I may be no good at it.
Welp, that certainly did help. Looks like I had gotten the majority of that down already from trial and error, I had just forgotten to add the actual door itself as a block, hence why it kept on crashing when I tried to place the item. Huh. Well, that's one more thing down. Now to keep slogging through adding textures and blocks so I may finally finish my project! Thanks for the help, too!
Cool. I look forward to seeing what you come up with.
As for the wiki, I'll look into editing it, but I've never done any wiki editing before, so I may be no good at it.
Look at what's already there, and then make it like that but up to date.
Also, try to move the old stuff to the bottom and put a {CS1} tag (literally just copy-and-paste those five characters) between the new stuff and the old stuff.
It's not hard, and anything you do wrong I'll fix. It's easier for me to clean up than to do it all myself.
Hello, i need create a script. I need to drop the item from the killed player on server. But i try use many way to do it. Still did not work =(
I remember entity type interactPlayer but it not work (or i do it not right). if you can help with script - write me please.
Possible Bug Report: When testing on LAN server on my own computer (2 minecraft windows on same computer), I am receiving crashes any time I use the onLeftClickPlayer on the another player. Here is the code I have tried using so far:
Both give exactly the same error for the player that used them, as well as telling the server the same error to explain the bad packet. The error is this:
--- BEGIN ERROR REPORT ae30f003 --------
Generated 10/2/12 7:44 AM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.6.0_34, Sun Microsystems Inc.
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
- Memory: 456161176 bytes (435 MB) / 514523136 bytes (490 MB) up to 954466304 bytes (910 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- FML: FML v3.0.196.366 Minecraft Forge 4.1.1.251 6 mods loaded, 6 mods active
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
mod_CodeChickenCore [CodeChicken Core] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
mod_NotEnoughItems [Not Enough Items] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
CustomStuff2 [Custom Stuff 2] (customStuff2_0.9.1_Beta_Universal.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
pitman-87_TF2_Teleporter [TF2 Teleporter] (TF2_Teleporter_1.3.2b.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
- LWJGL: 2.4.2
- OpenGL: GeForce GTS 250/PCIe/SSE2 GL version 3.3.0, NVIDIA Corporation
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
- World MpServer Entities: 2 total; [atg['Player'/2627, l='MpServer', x=-491.62, y=5.62, z=1414.85], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53]]
- World MpServer Players: 2 total; [atg['Player'/2627, l='MpServer', x=-491.62, y=5.62, z=1414.85], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53]]
- World MpServer Chunk Stats: MultiplayerChunkCache: 441
- Forced Entities: 3 total; [atg['Player'/2627, l='MpServer', x=-491.62, y=5.62, z=1414.85], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53]]
- Retry Entities: 0 total; []
java.lang.NullPointerException
at cubex2.mods.customstuff2.ScriptLoader.run(ScriptLoader.java:161)
at cubex2.mods.customstuff2.items.ItemFunctions.evaluateEvent(ItemFunctions.java:189)
at cubex2.mods.customstuff2.items.ItemFunctions.onLeftClickEntity(ItemFunctions.java:120)
at cubex2.mods.customstuff2.items.CustomItem.onLeftClickEntity(CustomItem.java:70)
at og.n(EntityPlayer.java:1156)
at atc.a(PlayerControllerMP.java:404)
at net.minecraft.client.Minecraft.c(Minecraft.java:1283)
at net.minecraft.client.Minecraft.l(Minecraft.java:1713)
at net.minecraft.client.Minecraft.J(Minecraft.java:834)
at net.minecraft.client.Minecraft.run(Minecraft.java:764)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT fe62892d ----------
The exact same error is given regardless of if it is the host or the other player and it is only the one that used the item that gets the crash.
A question about interactPlayer: The interactPlayer object is not listed in the help file so I am not sure what exactly it contains. Does it have exactly the same list of functions and the same syntax as player except use interactPlayer instead of player?
Cool. I look forward to seeing what you come up with.
Look at what's already there, and then make it like that but up to date.
Also, try to move the old stuff to the bottom and put a {CS1} tag (literally just copy-and-paste those five characters) between the new stuff and the old stuff.
It's not hard, and anything you do wrong I'll fix. It's easier for me to clean up than to do it all myself.
Thanks.
Well that wasn't too hard. Done and done. I may actually go through and add some more CS2 stuff to the wiki as I figure it out, as it'd probably be very useful to others, as well.
Edit: Also added some into the Normal block section to make it apparently how the metadata blocks work, cause there was nothing about that anywhere either, and that is by far one of the most useful features.
Now, another question: Is there any way to make a block that rotates depending on which direction you place it, kinda like the log blocks or anything? Or specifically, any way to make it so that the top texture of a block always faces the direction you place it, thus saving space in textures and metadata blocks? Or must it be done the old fashioned, convoluted way?
Possible Bug Report: When testing on LAN server on my own computer (2 minecraft windows on same computer), I am receiving crashes any time I use the onLeftClickPlayer on the another player. Here is the code I have tried using so far:
Both give exactly the same error for the player that used them, as well as telling the server the same error to explain the bad packet. The error is this:
--- BEGIN ERROR REPORT ae30f003 --------
Generated 10/2/12 7:44 AM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.6.0_34, Sun Microsystems Inc.
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
- Memory: 456161176 bytes (435 MB) / 514523136 bytes (490 MB) up to 954466304 bytes (910 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- FML: FML v3.0.196.366 Minecraft Forge 4.1.1.251 6 mods loaded, 6 mods active
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
mod_CodeChickenCore [CodeChicken Core] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
mod_NotEnoughItems [Not Enough Items] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
CustomStuff2 [Custom Stuff 2] (customStuff2_0.9.1_Beta_Universal.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
pitman-87_TF2_Teleporter [TF2 Teleporter] (TF2_Teleporter_1.3.2b.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
- LWJGL: 2.4.2
- OpenGL: GeForce GTS 250/PCIe/SSE2 GL version 3.3.0, NVIDIA Corporation
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
- World MpServer Entities: 2 total; [atg['Player'/2627, l='MpServer', x=-491.62, y=5.62, z=1414.85], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53]]
- World MpServer Players: 2 total; [atg['Player'/2627, l='MpServer', x=-491.62, y=5.62, z=1414.85], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53]]
- World MpServer Chunk Stats: MultiplayerChunkCache: 441
- Forced Entities: 3 total; [atg['Player'/2627, l='MpServer', x=-491.62, y=5.62, z=1414.85], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53], aur['Flamarow'/52, l='MpServer', x=-494.56, y=4.02, z=1414.53]]
- Retry Entities: 0 total; []
java.lang.NullPointerException
at cubex2.mods.customstuff2.ScriptLoader.run(ScriptLoader.java:161)
at cubex2.mods.customstuff2.items.ItemFunctions.evaluateEvent(ItemFunctions.java:189)
at cubex2.mods.customstuff2.items.ItemFunctions.onLeftClickEntity(ItemFunctions.java:120)
at cubex2.mods.customstuff2.items.CustomItem.onLeftClickEntity(CustomItem.java:70)
at og.n(EntityPlayer.java:1156)
at atc.a(PlayerControllerMP.java:404)
at net.minecraft.client.Minecraft.c(Minecraft.java:1283)
at net.minecraft.client.Minecraft.l(Minecraft.java:1713)
at net.minecraft.client.Minecraft.J(Minecraft.java:834)
at net.minecraft.client.Minecraft.run(Minecraft.java:764)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT fe62892d ----------
The exact same error is given regardless of if it is the host or the other player and it is only the one that used the item that gets the crash.
A question about interactPlayer: The interactPlayer object is not listed in the help file so I am not sure what exactly it contains. Does it have exactly the same list of functions and the same syntax as player except use interactPlayer instead of player?
That's a bug. It will be fixed next update.
interactPlayer is the same as player except the name, so you can use every function you can use for player also for interactPlayer.
Hello, i need create a script. I need to drop the item from the killed player on server. But i try use many way to do it. Still did not work =(
I remember entity type interactPlayer but it not work (or i do it not right). if you can help with script - write me please.
Do you mean the item the player is holding? You also have to use onLeftClickPlayer which doesn't work at the moment.
Thank you for correcting the shift click and I am getting used to using the 1 page load up. (I just think of it as "warming up" each page) I can get things to stay after placing them twice.( not a big deal). My only actual problem is, no matter how I work it, any item placed on page 4 or 5 ends up on page one when I return to the world after saving and playing another world or come back to the game the next day. Any suggestions on this quirk? If it doesn't get repaired, not that big a deal. I can simply play it as being a 3 page chest, Still way cooler than a big wad of chests in the room. lol And thanks for the quick response on the previous post :-)
There some strange behaviours with the chest at the moment. I hope I can fix them when I'm going to do the update for it.
Rollback Post to RevisionRollBack
I'm on twitter: @CubeX2_. Follow me for upcoming features and other stuff ;).
That's a bug. It will be fixed next update.
interactPlayer is the same as player except the name, so you can use every function you can use for player also for interactPlayer.
After update can i use interactPlayer.addPotionEffect?
There some strange behaviours with the chest at the moment. I hope I can fix them when I'm going to do the update for it.
Thanks, I look forward to new developments. I will simply regard it as a 3 page chest in the interim. I love the concept you've implemented with the CS2. Makes me wish I knew some java. All your regular posters seem very knowledgeable and helpful. Appreciate the quick response.
When minecraft update to 1.4 will you add a item type 'head'? It looks like helmet but helmet has size more then head. Type 'head' for block can work like 'door' type. =)
CubeX2, Flamarow, and Alvoria, you may remember how my grinder would work perfectly but the gui said MISSING, right? Swell. Well, I changed one thing and one thing only: guiFile = "grinder.png"; to guiFile = "compressor.png"; I have them both in my Overhaul folder. It's just another picture, same size, only thing changed is the bar telling how much time is left for that fuel. Well, now my grinder successfully shows the gui, and now it does not grind. Why? Any thoughts? I can give you my files if you request, though it might not be helpful. EDIT: Do not pay attention, I just forgot the grinding recipe. Silly me! Thank you though.
EDIT EDIT: My compressor block doesn't work, though the grinder does. The compressor has copied from the grinder, with name and id changes. The grinder works perfectly, though the compressor doesn't work at all. The items just sit there. Also, the fuels and recipes are correctly in place, as far as I know. I can give you my files if you request, though it might not be helpful.
CubeX2, Flamarow, and Alvoria, you may remember how my grinder would work perfectly but the gui said MISSING, right? Swell. Well, I changed one thing and one thing only: guiFile = "grinder.png"; to guiFile = "compressor.png"; I have them both in my Overhaul folder. It's just another picture, same size, only thing changed is the bar telling how much time is left for that fuel. Well, now my grinder successfully shows the gui, and now it does not grind. Why? Any thoughts? I can give you my files if you request, though it might not be helpful. EDIT: Do not pay attention, I just forgot the grinding recipe. Silly me! Thank you though.
EDIT EDIT: My compressor block doesn't work, though the grinder does. The compressor has copied from the grinder, with name and id changes. The grinder works perfectly, though the compressor doesn't work at all. The items just sit there. Also, the fuels and recipes are correctly in place, as far as I know. I can give you my files if you request, though it might not be helpful.
Just to make sure, you changed the 'name' attribute and not just the 'display name'? I honestly am not sure what the exact problem would be. Go ahead and just upload the whole mod and leave a link and I will try testing and messing with it tomorrow after I get some sleep if someone else doesn't get to it first.
Just to make sure, you changed the 'name' attribute and not just the 'display name'? I honestly am not sure what the exact problem would be. Go ahead and just upload the whole mod and leave a link and I will try testing and messing with it tomorrow after I get some sleep if someone else doesn't get to it first.
Yeah I'll post it after school though I have to warn you it's pretty big.
On an example a few posts back it showed an example pickaxe but i noticed it set the id in the pickaxe's .js file. is it possible to set it's id using the mod.js? also, how do you set a block's toolclass?
On an example a few posts back it showed an example pickaxe but i noticed it set the id in the pickaxe's .js file. is it possible to set it's id using the mod.js? also, how do you set a block's toolclass?
Yes, it is possible to set the id from the mod.js file. This is done by using a config function to add a default id that gets written to a config file so users can change the ids easier.
//mod.js
//for blocks:
config.addBlockIdProperty("randomBlockID", 2401);
//for items:
config.addItemIdProperty("customPickaxeID", 8301);
//to add an alias (for recipes)
var CSpickaxe = config.getItemId("customPickaxeID");
mod.addAlias(CSpickaxe, "customPickaxe");
//in your pickaxe.js or w/e it is named
id = config.getItemId("customPickaxeID");
Hope that helps, feel free to ask more questions if you are confused.
I may have found a bug, but more likely I did something wrong. My slabs are not forming into double slabs even though I have settings in the slab files set.
This is the code I used:
doubleSlabId[0] = config.getBlockId("muddoubleslab1ID");
doubleSlabMeta[0] = "0";
Make sure you use single quotes (') or escape the double quotes (") (can't remember how to escape at this second) if you put it on one line for using directly in your function, otherwise, the double quotes will cause errors.
...How do you make a door in Custom Stuff 2? There's plenty of stuff about how to do it with the original version, but nothing since the update, as far as I can find, and that unfortunately includes the wiki. Just a basic rundown of the door itself, and the item dropped by it would be fantastic.
The same basic premise of the door can be drawn from CS1: it's a two-part piece that has both a block and an item as components. As such, you'll need to make both in order to use it, and most of the same basic rules apply.
The door block should always drop the door item when broken. Also, only the textureIndexYP[0] and textureIndexYN[0] are used for texturing, being the top and bottom halves of the door respectively.
For the item, you'll need to include a line that indicates that it's supposed to place the door. Here's an example:
If you're in the bad practice of hard-coding your block and item IDs, you can also just put the number you've assigned to the door block instead of the config.getBlockId stuff.
Finally, when adding these two things to the mod.js, you'll need to declare them both doors rather than normal types like so:
I hope that helped you. If you get it working, consider updating the wiki article as a way of saying thanks. If that didn't help you... please feel free to ask for help.
Welp, that certainly did help. Looks like I had gotten the majority of that down already from trial and error, I had just forgotten to add the actual door itself as a block, hence why it kept on crashing when I tried to place the item. Huh. Well, that's one more thing down. Now to keep slogging through adding textures and blocks so I may finally finish my project! Thanks for the help, too!
As for the wiki, I'll look into editing it, but I've never done any wiki editing before, so I may be no good at it.
Look at what's already there, and then make it like that but up to date.
Also, try to move the old stuff to the bottom and put a {CS1} tag (literally just copy-and-paste those five characters) between the new stuff and the old stuff.
It's not hard, and anything you do wrong I'll fix. It's easier for me to clean up than to do it all myself.
Thanks.
I remember entity type interactPlayer but it not work (or i do it not right). if you can help with script - write me please.
Both give exactly the same error for the player that used them, as well as telling the server the same error to explain the bad packet. The error is this:
A question about interactPlayer: The interactPlayer object is not listed in the help file so I am not sure what exactly it contains. Does it have exactly the same list of functions and the same syntax as player except use interactPlayer instead of player?
Well that wasn't too hard. Done and done. I may actually go through and add some more CS2 stuff to the wiki as I figure it out, as it'd probably be very useful to others, as well.
Edit: Also added some into the Normal block section to make it apparently how the metadata blocks work, cause there was nothing about that anywhere either, and that is by far one of the most useful features.
Now, another question: Is there any way to make a block that rotates depending on which direction you place it, kinda like the log blocks or anything? Or specifically, any way to make it so that the top texture of a block always faces the direction you place it, thus saving space in textures and metadata blocks? Or must it be done the old fashioned, convoluted way?
That's a bug. It will be fixed next update.
interactPlayer is the same as player except the name, so you can use every function you can use for player also for interactPlayer.
Do you mean the item the player is holding? You also have to use onLeftClickPlayer which doesn't work at the moment.
There some strange behaviours with the chest at the moment. I hope I can fix them when I'm going to do the update for it.
Yes, you can use it.
Thanks, I look forward to new developments. I will simply regard it as a 3 page chest in the interim. I love the concept you've implemented with the CS2. Makes me wish I knew some java. All your regular posters seem very knowledgeable and helpful. Appreciate the quick response.
CubeX2, Flamarow, and Alvoria, you may remember how my grinder would work perfectly but the gui said MISSING, right? Swell. Well, I changed one thing and one thing only: guiFile = "grinder.png"; to guiFile = "compressor.png"; I have them both in my Overhaul folder. It's just another picture, same size, only thing changed is the bar telling how much time is left for that fuel. Well, now my grinder successfully shows the gui, and now it does not grind. Why? Any thoughts? I can give you my files if you request, though it might not be helpful.EDIT: Do not pay attention, I just forgot the grinding recipe. Silly me! Thank you though.EDIT EDIT: My compressor block doesn't work, though the grinder does. The compressor has copied from the grinder, with name and id changes. The grinder works perfectly, though the compressor doesn't work at all. The items just sit there. Also, the fuels and recipes are correctly in place, as far as I know. I can give you my files if you request, though it might not be helpful.
Just to make sure, you changed the 'name' attribute and not just the 'display name'? I honestly am not sure what the exact problem would be. Go ahead and just upload the whole mod and leave a link and I will try testing and messing with it tomorrow after I get some sleep if someone else doesn't get to it first.
Yeah I'll post it after school though I have to warn you it's pretty big.
Yes, it is possible to set the id from the mod.js file. This is done by using a config function to add a default id that gets written to a config file so users can change the ids easier.
Hope that helps, feel free to ask more questions if you are confused.
Edit: fixed my mistake on getItemId...
This is the code I used:
doubleSlabId[0] = config.getBlockId("muddoubleslab1ID");
doubleSlabMeta[0] = "0";
Any ideas on what I could be doing wrong?