To set yourself (for what should that be good?) on fire, use for entity:
Player.getPlayerEnt()
Minecraft has (default) 20 ticks per second (example: put 100 for ticks to set for 5 seconds on fire).
But how do I make the player fall through a block, I tried but it doesn't set the block under the player just at were the player spawned if the player spawned over the block.
How do I detect the block under the player and make it do something.
Follow me on Twitter @B3HINDTH3SCR33N
//Replace "theblockid" with your ID.
function modTick()
{
if(Level.getTile(Player.getX(), Player.getY()-2, Player.getZ()==theblockid)
{
//Your statement/code here.
}
}
Wow I tried that but now that I check I forgot the Level. Part
Follow me on Twitter @B3HINDTH3SCR33N
I get this error
Error occurred in script: traps.js
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getTitle in object function Level() {
[native code, arity=0]
}
. (traps.js#20)
at org.mozilla.javascript.ScriptRuntime.constructError(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.constructError(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.typeError(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.typeError2(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(Unknown Source)
at org.mozilla.javascript.Interpreter.interpretLoop(Unknown Source)
at script.modTick(traps.js:20)
at org.mozilla.javascript.Interpreter.interpret(Unknown Source)
at org.mozilla.javascript.InterpretedFunction.call(Unknown Source)
at org.mozilla.javascript.ContextFactory.doTopCall(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.doTopCall(Unknown Source)
at org.mozilla.javascript.InterpretedFunction.call(Unknown Source)
at net.zhuoweizhang.mcpelauncher.ScriptManager.callScriptMethod(ScriptManager.java:254)
at net.zhuoweizhang.mcpelauncher.ScriptManager.tickCallback(ScriptManager.java:337)
at dalvik.system.NativeStart.run(Native Method)
Here is my code
function modTick()
{
if(Level.getTitle(Player.getX(),Player.getY()-2,Player.getZ())==248)
{
Entity.setFireTicks(player,900)
}
}
Follow me on Twitter @B3HINDTH3SCR33N
You put "Level.getTitle."
My bad
Follow me on Twitter @B3HINDTH3SCR33N
How do I set the player on fire?
Follow me on Twitter @B3HINDTH3SCR33N
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumso:
Entity.setFireTicks(entity, ticks);
To set yourself (for what should that be good?) on fire, use for entity:
Player.getPlayerEnt()
Minecraft has (default) 20 ticks per second (example: put 100 for ticks to set for 5 seconds on fire).
Okay thanks.
But how do I make the player fall through a block, I tried but it doesn't set the block under the player just at were the player spawned if the player spawned over the block.
Follow me on Twitter @B3HINDTH3SCR33N
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumChange the position of the player to 1 block downwards:
Entity.setPosition(getPlayerEnt(), Player.getX(), Player.getY()-1, Player.getZ());
Here is my code
var Id =Level.getTile(X,Y,Z);
function modTick(){
if(Id==249){
Entity.setPosition(getPlayerEnt(),Player.getPlayerX(),Player.getPlayerY()-1,Player.getPlayerZ());
}
}
Is it the same?
Follow me on Twitter @B3HINDTH3SCR33N
That would work, but you could make a more Minecrafty effect with more code.
var id = Level.getTile(X, Y, Z);
var id2 = Level.getTile(X, Player.getY(), Z);
function modTick()
{
if(id==249||id2==249)
{
Entity.setPosition(getPlayerEnt(), Player.getX(), Player.getY()-0.1, Player.getZ());
}
}
Here is my code
/*made by xXbehind_the_screenXx*/
/*variables*/
var Block =Block.defineBlock
var shaped =Item.addShapedRecipe
var player =Player.getEntity()
var X =Player.getX()
var Y =Player.getY()
var Z =Player.getZ()
var Id =Level.getTile(X,Y,Z);
var id2 = Level.getTile(X, Player.getY(), Z);
/*items*/
/*blocks*/
Block(248,"FT","cobblestone",0);
Block(249,"Ghost Block","cobblestone",0);
/*Recipes*/
shaped(247,1,0,[
"gng",
"fff",
""
],["c",263,0,"g",289,0,"f",259,0,"n",87,0]);
/*functionality*/
//ft
function modTick()
{
if(Level.getTile(X,Y-2,Z)==248)
{
Entity.setFireTicks(player,40);
}
}
//
function modTick()
{
if(id==249||id2==249)
{
Entity.setPosition(getPlayerEnt(),X,Y-0.1,Z);
}
}
Can you tell me why my block launcher keeps crashing.
Follow me on Twitter @B3HINDTH3SCR33N
/*made by xXbehind_the_screenXx*/
/*variables*/
var Block =Block.defineBlock
var shaped =Item.addShapedRecipe
var player =Player.getEntity()
var X =Player.getX()
var Y =Player.getY()-1
var Z =Player.getZ()
var Id =Level.getTile(X,Y,Z);
var id2 = Level.getTile(X, Player.getY(), Z);
/*items*/
/*blocks*/
Blocl(248,"FT",["cobblestone",0]);
Block(249,"Ghost Block",["cobblestone",0]);
/*Recipes*/
shaped(247,1,0,[
"gng",
"fff",
""
],["c",263,0,"g",289,0,"f",259,0,"n",87,0]);
/*functionality*/
//ft
function modTick()
{
if(Level.getTile(X,Y-2,Z)==248)
{
Entity.setFireTicks(player,40);
}
if(id==249||id2==249)
{
Entity.setPosition(getPlayerEnt(),X,Y-0.1,Z);
}
}
What do you mean by that
Follow me on Twitter @B3HINDTH3SCR33N
What do you mean by leaving me alone by my problem
Why would you say that?
Follow me on Twitter @B3HINDTH3SCR33N
You can only have one type of each function per mod, so you putting multiple modTick()s disables the first modTick().