#modify Block to transparency

20 messages · Page 1 of 1 (latest)

rose ocean
#

i mod textures for a block and want to make it transparency.
where is the problem:

StartupEvents.registry('block', event => {

event.modify('cyclic:unbreakable_block').defaultTranslucent()

})

lilac lintelBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

rose ocean
#

modify Block to transparency

rose ocean
#

i have change the script to BlockEvents.modification

#

new script is

#

BlockEvents.modification('block', event => {

event.modify('cyclic:unbreakable_block').defaultTranslucent()

})

#

but now i receive

#

startup_scripts:modify_blocks.js:2: Event handler 'BlockEvents.modification' doesn't support extra id!

#

new change

#

new code

#

BlockEvents.modification(e => {
e.modify('cyclic:unbreakable_block', block => {
block.defaultTranslucent()
})
})

#

new problem

#

Error occurred while handling event 'BlockEvents.modification': TypeError: Cannot find function defaultTranslucent in object Block{cyclic:unbreakable_block}. (startup_scripts:modify_blocks.js#4)

rose ocean
#

new code

#

BlockEvents.modification(e => {
e.modify('cyclic:unbreakable_block', block => {
block.defaultTranslucent = true
})
})

#

Error occurred while handling event 'BlockEvents.modification': Java class "com.lothrazar.cyclic.block.bedrock.UnbreakableBlock" has no public instance field or method named "defaultTranslucent". (startup_scripts:modify_blocks.js#3)

viscid crowBOT
#

You can write your code in a codeblock by typing it between the codeblock delimiters:

```js :arrow_left:
onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
``` :arrow_left:

As an example, :arrow_up: will look like this:

onEvent('recipes', e => {
  e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})