Open slice opened 8 years ago
Yea, some 'issues' state how those functions would look like
Redstone is tracked on #303; the last one should be easy to do.
Also, in regards to the original title: there's already an issue somewhere about that topic; I can't really address it at this time since so many scripts depend on current behaviour
Do you just want
DOWN = 0,
UP = 1,
NORTH = 2,
SOUTH = 3,
WEST = 4,
EAST = 5;
? I'm adding that.
@zhuowei Sure! Sorry if I sound like a bit demanding. Regarding the original title, that was already in another issue (like you said).
Remember to add per damage destroy hardness! You told me on Twitter to remind you.
@ShadowMine64 It's on the wishlist
@sliceofcode yeah, I added it then told him to yell at me to make sure I did add it
@zhuowei Oh. lol
:P
@thejaustin per data value hardness, actually (Sorry about the mistake); basically one would allow each data value of a block to have its own hardness (how long it takes to mine) and probably its own explosion resistance (how much TNT you need to blow it up). Minecraft has support for this (the stair block has different explosion resistances for each type of stairs, even though it uses the same block ID) but ModPE scripts don't have support for that yet
Useful if you need to save block IDs, I guess.
@sliceofcode To make the most basic redstone block, I need to expose these methods to ModPE scripts' custom blocks:
Block::onRedstoneUpdate Block::getSignal Block::isRedstoneBlock
and probably a Level.getRedstoneLevelOrSomething method
should they be done as hooks, as some sort of callback that you set on each custom block, or...
function redstoneHook(x, y, z, powerStrength){
}
And add a new function like Block.isRedstone(id, boolean);
That's a terrible idea, there needs to be more parameters than that, have you read the library? Do you know how long it takes to make a new dimension?
It's never gonna happen
@zhuowei Probably hooks.
@sliceofcode @zhuowei How many hooks tho o.O
@ShadowMine64
Block::onRedstoneUpdate
@sliceofcode It was a retorical question :P
For the enchantments : Item.addEnchantRecipe(id,levels,no. of lapiz); Also if(Item.get enchantment() For The Potions ModPE.setPotion() So it can be eaten without lessening the hunger
Request @zhuowei can U make an example on Redstone hooks after you added it and an official implementation off function eatHook()
Item.getIcon(id,dmg); that returns the icon name used in items.meta Entity.getMaxHealth(entity); And nbt, Idk how but I want nbt xD
Plz
These would be very useful ModPE methods in the future. Thanks for all your work you put into Blocklaucher! :)
Level.canSeeSky(x, y, z); - returns bool, use BlockSource::canSeeSky, it would be useful to not have to use loops.
Player.isSneaking(); - pretty obvious, but for now I am using a custom method with Enitity.isSneaking() and Player.getEntity()
Block.setPathFindable(blockID); - this has been an issue with custom shapes, mobs and players will "auto" jump
Block.getDestroyTime(blockID); - Making an array for this is painful.
Block.setExpDrop(blockID, int); Block.setFriction(blockID, float); Block.isCropBlock(blockID); Block.isContainerBlock(blockID); Block.isCraftingBlock(blockID); Block.isInteractiveBlock(blockID);
These functions would be very useful, thanks again
@ManassehPierce That's a great idea! That'd make a lot of things easier, but with would the is block functions be for?
Added new requests to wishlist, RIP @zhuowei
@manassehPierce
for now I am using a custom method with Enitity.isSneaking() and Player.getEntity()
That's what you're supposed to do ;) I won't add a Player.(whatever) method that does the exact same thing as an Entity.(whatever) method
I've added canSeeSky, getDestroyTime, get/setFriction, getMaxHealth in latest beta.
Custom blocks can now respond to redstone currents (they can't output them yet) - see piston.js in zhuowei/ModPEScripts for an example
Zhuowei FTW :v
Item.setEnchant and Item.getEnchant would not be able to work that way; you want enchantments for the specific item in your inventory. The way you're putting it would mean any item with that id would get enchanted. ModPE would need a specific item identifier in your inventory; such as Item.selectCarried() and Item.selectFromInventorySlot(slot)
Item.set(tool) isn't needed; there are easy workarounds to these anyway, setting destroy times for tools and negating bonus health with attackHook (Entity.setHealth(Entity.getHealth-(hearts)). In MCPE there is no custom drop time ability, all are fixed at 20 ticks or whatever, so Zhuowei would have do to a TON of modding to do that.
Block.getDimension so we can check if a block is at a certain dimension, use BlockSource::getDimension
@ShadowMine64 ... you mean Player.getDimension? All hooks only happen in the Player's dimension, I thought?
It would still be useful for blocks
Item.getMaxDamage();
[I crash when I enable my resource pack :/]
Nvm I found a fix but now I keep crashing on world load :/ I can send the script, tp, and addon if you need :|
Another great method would be ModPE.setItemCategoryIcon(ItemCategory.CATEGORY, ITEM_ID_HERE). This method would change the icon of the specified creative tab. Also it would be great if there were some methods to stop entities from moving.
For Entity.isBaby(); just need use Entity.getAnimalAge(entity); and if are -1 or less it means that is a baby And Entity.setBaby(); = Entity.setAnimalAge(entity,-1 or less); El nov. 29, 2015 10:01 AM, "ISAAC300" notifications@github.com escribió:
Entity.isBaby(ent,bool); or Entity.setBaby(ent,bool); Entity.isTamable(ent,bool); or Entity.setTamable(ent,bool); Player.getCarriedItemName(); Block.is/setWaterBlock(id,bool);
— Reply to this email directly or view it on GitHub https://github.com/zhuowei/MCPELauncher/issues/329#issuecomment-160427505 .
Could you guys please be more realistic (specially you izaac)?
Oh, Zhuowei, what you mentioned about signal strength, I found setter and getter functions for redstone signal @zhuowei
@zhuowei for redstone signal (in order):
Good luck.
Emm sorry? El nov. 29, 2015 2:52 PM, "ISAAC300" notifications@github.com escribió:
taquito cala-te
— Reply to this email directly or view it on GitHub https://github.com/zhuowei/MCPELauncher/issues/329#issuecomment-160470454 .
Isaac you should really stop, you keep requesting irrelevent functions
Sorry, but I'm only adding real suggestions to the list.
function genOre(minY,maxY,chunk,Id){ //I know there's a workaround for that
@officialmcpro32 That MIGHT be possible but the only problem is that the native way causes crashes on world generator and if it gets past that, the game freezes then crashes after a few seconds
Entity.setTarget(attacker, victim) using Mob::setTarget(Mob*);
Entity.getTarget(entity) using Mob::getTarget();
Item.addDescription(id, string) using Item::buildDescriptionName(ItemInstance const&) const;
Item.addEffectDescription(id, string) using Item::buildEffectDescriptionName(ItemInstance const&) const;
Item.canDestroyInCreative(id, bool) using Item::canDestroyInCreative() const;
Block.setSoundType(id, string) using Block::setSoundType(Block::SoundType const&);
Block.animateTick(id, scriptable) using Block::animateTick(BlockSource&, BlockPos const&, Random&);
Entity.changeDimension(entity, DimensionId) using Level::entityChangeDimension(Entity&, DimensionId);
function fallHook(x, y, z, ent) for hook if the entity is falling
Thats my suggestions
Please add my suggestions on the commit file on the code section @zhuowei
LMAOOO
please add Item.createIcon(icon id, icon opaque); if its possible because i saw codes on the Vanilla Minecraft Mods that has a create icon method
@KairusDarkSeeker That wouldn't be necessary, that would be used mainly for doors, trap doors, etc..
but i saw it on a vanilla minecraft mod
just create a texture pack using IsoPix
@Izaac9236 just make a resource pack
ModPE Wishlist
If you could be so kind @zhuowei, could you add some more features for us?
(added by zhuowei - I guess this is the official wishlist now? yes)
Block
Block.click(x, y, z);
- "clicks" a blockBlock.isCropBlock(blockID);
Block.isContainerBlock(blockID);
Block.isCraftingBlock(blockID);
Block.isInteractiveBlock(blockID);
Block.setPathFindable(blockID);
- this has been an issue with custom shapes, mobs and players will "auto" jumpBlock.getDestroyTime(blockID);
- Making an array for this is painful.Block.setExpDrop(blockID, int);
Block.setFriction(blockID, float);
Item.getIcon(id,dmg);
that returns the icon name used in items.metaModPE.setItemCategoryIcon(ItemCategory.CATEGORY, ITEM_ID_HERE)
ModPE.getBlockLauncherVersion();
ModPE.setGameVersion(string);
sets the MC:PE version, like the one shown in betasEntity
Entity.changeDimension(entity, DimensionId) using Level::entityChangeDimension(Entity&, DimensionId);
Entity.setTarget(attacker, victim) using Mob::setTarget(Mob*);
Entity.getTarget(entity) using Mob::getTarget();
Entity.setCanMove(canMove);
Entity.getCanMove();
Entity.getMaxHealth(entity);
Item
Item.addDescription(id, string) using Item::buildDescriptionName(ItemInstance const&) const;
Item.addEffectDescription(id, string) using Item::buildEffectDescriptionName(ItemInstance const&) const;
Item.canDestroyInCreative(id, bool) using Item::canDestroyInCreative() const;
Level
Level.canSeeSky(x, y, z);
- returns bool, use BlockSource::canSeeSky, it would be useful to not have to use loops.Block
Block.setSoundType(id, string) using Block::setSoundType(Block::SoundType const&);
Block.animateTick(id, scriptable) using Block::animateTick(BlockSource&, BlockPos const&, Random&);