and it doesn't crash, but it doesn't seem to increase the distance that it's visible from. Or is this only to limit the distance to an amount lower than 16?
I saw that you added onUpdate to entities (TY for that), but I wanted to fiddle around with this first, see what it could do.
and it doesn't crash, but it doesn't seem to increase the distance that it's visible from. Or is this only to limit the distance to an amount lower than 16?
I saw that you added onUpdate to entities (TY for that), but I wanted to fiddle around with this first, see what it could do.
I guess you use it in onRandomDisplayTick that is only called for blocks in a 16 block radius. Increasing the distance for the particle doesn't do anything as it will never be called.
Rollback Post to RevisionRollBack
I'm on twitter: @CubeX2_. Follow me for upcoming features and other stuff ;).
i posted this a while back but nobody responded: i used the official documentation, pretty much exactly the same as the platinum code you put in it, but with the names changed, and i got http://pastebin.com/5qbrut8c
i posted this a while back but nobody responded: i used the official documentation, pretty much exactly the same as the platinum code you put in it, but with the names changed, and i got http://pastebin.com/5qbrut8c
Hey. I have an idea about interfaces. If you can just add a support for handleing left mouse button click, then there is no need for adding buttons to the GUI (if it is possible at all due to client-only things in onDraw). Even a dropdown menu will be possible. Just a little bit of rework required. And then it is only a matter of setting slots position whenever you want them and that`s it. By the way, it would be neet if you add a possibility to draw images on screen when you are NOT in GUI, like you hold an item and the texture or a name of the block you stearing at will be displayed.
Or if the left click functionality isn`t possible, then maybe it is possible to create a gohst items? Like when you take them out of the block inventory they get removed from your hand immidietly. It is possible to create something like that now by shift+left clicking the item in chest which has an a scipt which deletes this item when it is in your inventory and places this item back into chest, but this requires an empty inventory slot and if you just left click you will end up with this thing in your hand which you can drop into world or put anywhere else which is not so good.
Also will it be possible to change item description ingame? So for example if onUpdate executed then the description number will be increase by one displaying 1, then after one tick - 2, then 3 and etc.
Hey. I hav an idea about interfaces. If you can just add a support for handleing left mouse button click, then there is no need for adding buttons to the GUI (if it is possible at all due to client-only things in onDraw). Even a dropdown menu will be possible. Just a little bit of rework required. And then it is only a matter of setting slots position whenever you want them and that`s it. By the way, it would be neet if you add a possibility to draw images on screen when you are NOT in GUI, like you hold an item and the texture or a name of the block you stearing at will be displayed.
Or if the left click functionality isn`t possible, then maybe it is possible to create a gohst items? Like when you take them out of the block inventory they get removed from your hand immidietly. It is possible to create something like that now by shift+left clicking the item in chest which has an a scipt which deletes this item when it is in your inventory and places this item back into chest, but this requires an empty inventory slot and if you just left click you will end up with this thing in your hand which you can drop into world or put anywhere else which is not so good.
Also will it be possible to change item description ingame? So for example if onUpdate executed then the description number will be increase by one displaying 1, then after one tick - 2, then 3 and etc.
Thanks for awesome work you done =)
I'm not going to add handling mouse clicks and buttons to CS2 but to CS3.
You can already draw something on the screen using mod.registerIngameRenderer(). However you can't use world or player as of now. I'll add that in an update soon.
Changing the item description is not possible at the moment. I might add something to allow this in the future.
Rollback Post to RevisionRollBack
I'm on twitter: @CubeX2_. Follow me for upcoming features and other stuff ;).
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getBlockType in object 2.
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3949)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3927)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3955)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3974)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:4046)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2423)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2405)
at org.mozilla.javascript.gen.drill_up_js_8._c_lwc_5(drill_up.js:91)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_around_4(drill_up.js:65)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_column_8(drill_up.js:142)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_script_0(drill_up.js:415)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.gen.drill_up_js_8.exec(drill_up.js)
at cubex2.cs2.scripting.ScriptableMod.loadScript(ScriptableMod.java:94)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1479)
at script(onUse)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:223)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:100)
at cubex2.cs2.item.WrappedItem.onItemUse(WrappedItem.java:78)
at cubex2.cs2.item.ItemCSPickaxe.func_77648_a(ItemCSPickaxe.java:80)
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:129)
at net.minecraft.client.multiplayer.PlayerControllerMP.func_78760_a(PlayerControllerMP.java:360)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1447)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1953)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getBlockType in object 2.
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3949)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3927)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3955)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3974)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:4046)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2423)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2405)
at org.mozilla.javascript.gen.drill_up_js_8._c_lwc_5(drill_up.js:91)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_around_4(drill_up.js:65)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_column_8(drill_up.js:142)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_script_0(drill_up.js:415)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.gen.drill_up_js_8.exec(drill_up.js)
at cubex2.cs2.scripting.ScriptableMod.loadScript(ScriptableMod.java:94)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1479)
at script(onUse)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:223)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:100)
at cubex2.cs2.item.WrappedItem.onItemUse(WrappedItem.java:78)
at cubex2.cs2.item.ItemCSPickaxe.func_77648_a(ItemCSPickaxe.java:80)
at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:505)
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:128)
at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:389)
at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:556)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9)
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getBlockType in object 2.
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3949)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3927)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3955)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3974)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:4046)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2423)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2405)
at org.mozilla.javascript.gen.drill_up_js_8._c_lwc_5(drill_up.js:91)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_around_4(drill_up.js:65)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_column_8(drill_up.js:142)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_script_0(drill_up.js:415)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.gen.drill_up_js_8.exec(drill_up.js)
at cubex2.cs2.scripting.ScriptableMod.loadScript(ScriptableMod.java:94)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1479)
at script(onUse)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:223)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:100)
at cubex2.cs2.item.WrappedItem.onItemUse(WrappedItem.java:78)
at cubex2.cs2.item.ItemCSPickaxe.func_77648_a(ItemCSPickaxe.java:80)
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:129)
at net.minecraft.client.multiplayer.PlayerControllerMP.func_78760_a(PlayerControllerMP.java:360)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1447)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1953)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getBlockType in object 2.
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3949)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3927)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3955)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3974)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:4046)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2423)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2405)
at org.mozilla.javascript.gen.drill_up_js_8._c_lwc_5(drill_up.js:91)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_around_4(drill_up.js:65)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_column_8(drill_up.js:142)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_script_0(drill_up.js:415)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.gen.drill_up_js_8.exec(drill_up.js)
at cubex2.cs2.scripting.ScriptableMod.loadScript(ScriptableMod.java:94)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1479)
at script(onUse)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:223)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:100)
at cubex2.cs2.item.WrappedItem.onItemUse(WrappedItem.java:78)
at cubex2.cs2.item.ItemCSPickaxe.func_77648_a(ItemCSPickaxe.java:80)
at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:505)
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:128)
at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:389)
at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:556)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9)
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
.
mod.getBlockType works just fine for me. It seems that the function is called on "2" instead of a mod object. How do you call that script?
Rollback Post to RevisionRollBack
I'm on twitter: @CubeX2_. Follow me for upcoming features and other stuff ;).
I've been quite mad at myself for doing that for a long time. I'll see if changing them will bring any big consequences but I think I might just make each configurable.
Rollback Post to RevisionRollBack
If you speak Portuguese and play Minecraft: Java Edition like me, join my rabbit hole on Discord!
Hello again. I`ve tested your nbt functions and thats seems awesome. Now i see why there is no way for now to change item description, but at least i can do anything with item names. And can you please add getNbt(int slotId) functions to player and world? Using getNbt() only for itemstack is not realy useful. Or add getItemstack(int slotId) to player and world which is probably more reasonable, because most of the time item nbt should be changed while it is not right clicked or something which has scriptable itemstack on it, but from onUpdate for block i.e.
That's one cool mod, I'll be sure to download all
(also sorry to hog the attention but can
u guys pls check out my other threads.
i have one on what to add to my world
and I need suggestions, okay sorry)
Nice mods.
CubeX2, could I get a brief explanation on how to use the new maxDistance modifier? I'm trying
world.spawnParticle('largesmoke', position, 0.0, 0.2, 0.0, 64.0)
and it doesn't crash, but it doesn't seem to increase the distance that it's visible from. Or is this only to limit the distance to an amount lower than 16?
I saw that you added onUpdate to entities (TY for that), but I wanted to fiddle around with this first, see what it could do.
I guess you use it in onRandomDisplayTick that is only called for blocks in a 16 block radius. Increasing the distance for the particle doesn't do anything as it will never be called.
i posted this a while back but nobody responded: i used the official documentation, pretty much exactly the same as the platinum code you put in it, but with the names changed, and i got http://pastebin.com/5qbrut8c
Please to post your mod.js file.
This game is so oreing.
Hey. I have an idea about interfaces. If you can just add a support for handleing left mouse button click, then there is no need for adding buttons to the GUI (if it is possible at all due to client-only things in onDraw). Even a dropdown menu will be possible. Just a little bit of rework required. And then it is only a matter of setting slots position whenever you want them and that`s it. By the way, it would be neet if you add a possibility to draw images on screen when you are NOT in GUI, like you hold an item and the texture or a name of the block you stearing at will be displayed.
Or if the left click functionality isn`t possible, then maybe it is possible to create a gohst items? Like when you take them out of the block inventory they get removed from your hand immidietly. It is possible to create something like that now by shift+left clicking the item in chest which has an a scipt which deletes this item when it is in your inventory and places this item back into chest, but this requires an empty inventory slot and if you just left click you will end up with this thing in your hand which you can drop into world or put anywhere else which is not so good.
Also will it be possible to change item description ingame? So for example if onUpdate executed then the description number will be increase by one displaying 1, then after one tick - 2, then 3 and etc.
Thanks for awesome work you done =)
I'm not going to add handling mouse clicks and buttons to CS2 but to CS3.
You can already draw something on the screen using mod.registerIngameRenderer(). However you can't use world or player as of now. I'll add that in an update soon.
Changing the item description is not possible at the moment. I might add something to allow this in the future.
Hi again!
Well, i'm in trouble trying to make a custom worldgen mod for Monoblocks mod, but it have a peculiar issue: the block names have SPACES.
So, putting an block with spaces in a worldgen file, they wont generate in the world.
mod.js:
/*
* Mod: MonoBlocks - GalacticCraft-Compatible WorldGen (Less aggressive)
* Descrição: Geração de ores "direita", e compativel com os ores do GalacticCraft
* Tipo: WorldGen
* Versão: 1.7_1.0
* Criado: 22:14 09/08/2015
* Última Modificação: -
*/
/* Setar Configurações */
// Silver
config.addBooleanProperty("oreSilverWorldGenEnabled", "worldgen", true, "Is silver ore worldgen enabled?");
// Zinc
config.addBooleanProperty("oreZincWorldGenEnabled", "worldgen", true, "Is zinc ore worldgen enabled?");
// Purple Crystal
config.addBooleanProperty("orePurpleCrystalWorldGenEnabled", "worldgen", true, "Is purple crystal ore worldgen enabled?");
// Red Crystal
config.addBooleanProperty("oreRedCrystalWorldGenEnabled", "worldgen", true, "Is red crystal ore worldgen enabled?");
/* Adição ou não dos worldgens */
// Silver
if (config.getBoolean("oreSilverWorldGenEnabled", "worldgen"))
{
mod.addWorldGen("oreSilver.js", "ore");
}
// Zinc
if (config.getBoolean("oreZincWorldGenEnabled", "worldgen"))
{
mod.addWorldGen("oreZinc.js", "ore");
}
// Purple Crystal
if (config.getBoolean("orePurpleCrystalWorldGenEnabled", "worldgen"))
{
mod.addWorldGen("orePurpleCrystal.js", "ore");
}
// Red Crystal
if (config.getBoolean("oreRedCrystalWorldGenEnabled", "worldgen"))
{
mod.addWorldGen("oreRedCrystal.js", "ore");
}
Zinc ore (doesn't have spaces, works):
block = "Monoblocks:ZincOre";
blockMeta = 0;
minHeight = 1;
maxHeight = 110;
generationsPerChunk = 27.0;
numberOfBlocks = 6;
generateInOverworld = true;
generateInNether = false;
generateInEnd = false;
allowedBiomes = "Ocean,Plains,Desert,Extreme Hills,Forest,Taiga,Swampland,River,FrozenOcean,FrozenRiver,Ice Plains,Ice Mountains,MushroomIsland,MushroomIslandShore,Beach,DesertHills,ForestHills,TaigaHills,Extreme Hills Edge,Jungle,JungleHills,JungleEdge,Deep Ocean,Stone Beach,Cold Beach,Birch Forest,Birch Forest Hills,Roofed Forest,Cold Taiga,Cold Taiga Hills,Mega Taiga,Mega Taiga Hills,Extreme Hills+,Savanna,Savanna Plateau,Mesa,Mesa Plateau F,Mesa Plateau,Sunflower Plains,Desert M,Extreme Hills M,Flower Forest,Taiga M,Swampland M,Ice Plains Spikes,Jungle M,JungleEdge M,Birch Forest M,Birch Forest Hills M,Roofed Forest M,Cold Taiga M,Mega Spruce Taiga,Mega Spruce Taiga,Extreme Hills+ M,Savanna M,Savanna Plateau M,Mesa (Bryce),Mesa Plateau F M,Mesa Plateau M,fwg_default1,fwg_default2,fwg_default_snow,owg_desert,owg_forest,owg_plains,owg_rainforest,owg_savanna,owg_seasonalForest,owg_shrubland,owg_swampland,owg_taiga,owg_tundra,owg_Classic,owg_Classic_Snow,rwg_riverIce,rwg_riverCold,rwg_riverTemperate,rwg_riverHot,rwg_riverWet,rwg_riverOasis,rwg_oceanIce,rwg_oceanCold,rwg_oceanTemperate,rwg_oceanHot,rwg_oceanWet,rwg_oceanOasis,rwg_snowDesert,rwg_snowForest,rwg_coldPlains,rwg_coldForest,rwg_hotPlains,rwg_hotForest,rwg_hotDesert,rwg_plains,rwg_tropical,rwg_redwood,rwg_jungle,rwg_oasis,rwg_temperateForest";
overworldReplacedBlocks = "minecraft:stone";
Red Crystal Ore, have spaces, doesn't work:
block = "Monoblocks:Red Crystal Ore";
blockMeta = 0;
minHeight = 1;
maxHeight = 128;
generationsPerChunk = 15.0;
numberOfBlocks = 2;
generateInOverworld = true;
generateInNether = false;
generateInEnd = false;
allowedBiomes = "Ocean,Plains,Desert,Extreme Hills,Forest,Taiga,Swampland,River,FrozenOcean,FrozenRiver,Ice Plains,Ice Mountains,MushroomIsland,MushroomIslandShore,Beach,DesertHills,ForestHills,TaigaHills,Extreme Hills Edge,Jungle,JungleHills,JungleEdge,Deep Ocean,Stone Beach,Cold Beach,Birch Forest,Birch Forest Hills,Roofed Forest,Cold Taiga,Cold Taiga Hills,Mega Taiga,Mega Taiga Hills,Extreme Hills+,Savanna,Savanna Plateau,Mesa,Mesa Plateau F,Mesa Plateau,Sunflower Plains,Desert M,Extreme Hills M,Flower Forest,Taiga M,Swampland M,Ice Plains Spikes,Jungle M,JungleEdge M,Birch Forest M,Birch Forest Hills M,Roofed Forest M,Cold Taiga M,Mega Spruce Taiga,Mega Spruce Taiga,Extreme Hills+ M,Savanna M,Savanna Plateau M,Mesa (Bryce),Mesa Plateau F M,Mesa Plateau M,fwg_default1,fwg_default2,fwg_default_snow,owg_desert,owg_forest,owg_plains,owg_rainforest,owg_savanna,owg_seasonalForest,owg_shrubland,owg_swampland,owg_taiga,owg_tundra,owg_Classic,owg_Classic_Snow,rwg_riverIce,rwg_riverCold,rwg_riverTemperate,rwg_riverHot,rwg_riverWet,rwg_riverOasis,rwg_oceanIce,rwg_oceanCold,rwg_oceanTemperate,rwg_oceanHot,rwg_oceanWet,rwg_oceanOasis,rwg_snowDesert,rwg_snowForest,rwg_coldPlains,rwg_coldForest,rwg_hotPlains,rwg_hotForest,rwg_hotDesert,rwg_plains,rwg_tropical,rwg_redwood,rwg_jungle,rwg_oasis,rwg_temperateForest";
overworldReplacedBlocks = "minecraft:stone";
So is there a way to enable spaced item names to being recognized by CS2, or is it a bad practice?
BTW, posted this same issue in Monoblocks thread too.
If you speak Portuguese and play Minecraft: Java Edition like me, join my rabbit hole on Discord!
look do you know how to speak english
look is this a finished mod or in progress mod
look is this a finished mod or work in progress mod
I think this is a bug. CustomStuff2: I'm trying to use mod.getBlockType() from an onUse event in an item:
The script:
The error:
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getBlockType in object 2.
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3949)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3927)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3955)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3974)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:4046)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2423)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2405)
at org.mozilla.javascript.gen.drill_up_js_8._c_lwc_5(drill_up.js:91)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_around_4(drill_up.js:65)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_column_8(drill_up.js:142)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_script_0(drill_up.js:415)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.gen.drill_up_js_8.exec(drill_up.js)
at cubex2.cs2.scripting.ScriptableMod.loadScript(ScriptableMod.java:94)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1479)
at script(onUse)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:223)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:100)
at cubex2.cs2.item.WrappedItem.onItemUse(WrappedItem.java:78)
at cubex2.cs2.item.ItemCSPickaxe.func_77648_a(ItemCSPickaxe.java:80)
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:129)
at net.minecraft.client.multiplayer.PlayerControllerMP.func_78760_a(PlayerControllerMP.java:360)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1447)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1953)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getBlockType in object 2.
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3949)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3927)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3955)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3974)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:4046)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2423)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2405)
at org.mozilla.javascript.gen.drill_up_js_8._c_lwc_5(drill_up.js:91)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_around_4(drill_up.js:65)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_column_8(drill_up.js:142)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.drill_up_js_8._c_script_0(drill_up.js:415)
at org.mozilla.javascript.gen.drill_up_js_8.call(drill_up.js)
at org.mozilla.javascript.gen.drill_up_js_8.exec(drill_up.js)
at cubex2.cs2.scripting.ScriptableMod.loadScript(ScriptableMod.java:94)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1479)
at script(onUse)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:223)
at cubex2.cs2.util.JavaScriptHelper.executeTrigger(JavaScriptHelper.java:100)
at cubex2.cs2.item.WrappedItem.onItemUse(WrappedItem.java:78)
at cubex2.cs2.item.ItemCSPickaxe.func_77648_a(ItemCSPickaxe.java:80)
at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:505)
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:128)
at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:389)
at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:556)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9)
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
.
This game is so oreing.
I just pass the block name to forge, so there is no way for me to fix this. Block names really shouldn't use spaces.
mod.getBlockType works just fine for me. It seems that the function is called on "2" instead of a mod object. How do you call that script?
It works. No bug. PEBKAC
I had made a variable named "mod" earlier in the script ages ago before adding the call to getBlockType recently. Whups.
This game is so oreing.
Is there currently a function to get the localized name of a block/item?
This game is so oreing.
There isn't. I will add one on the weekend.
Ooh! Thank you! =^.^=
This game is so oreing.
Confirmed to be goldensilver853's side. Thank you anyway!
If you speak Portuguese and play Minecraft: Java Edition like me, join my rabbit hole on Discord!
Hello again. I`ve tested your nbt functions and thats seems awesome. Now i see why there is no way for now to change item description, but at least i can do anything with item names. And can you please add getNbt(int slotId) functions to player and world? Using getNbt() only for itemstack is not realy useful. Or add getItemstack(int slotId) to player and world which is probably more reasonable, because most of the time item nbt should be changed while it is not right clicked or something which has scriptable itemstack on it, but from onUpdate for block i.e.
Thanks for the new functions, CubeX2!! =^_^=
This game is so oreing.