Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Maxwelllondon

Members
  • Joined

  • Last visited

  1. First of all, this is one of my first scripts, so I didn't even know it could be writed better than this. It works, then for me it's fine. But, if you have any suggestion for a better code I'm happy to read you. Second, I couldn't find any APIs that remove points. I found setValue only. And yes, I'm writing with JavaScript.
  2. I have a scripted block designed to summon an item above it if a player scoreboard is >100, then remove 100 from scoreboard. function tick(event) { var player = event.block.world.getAllPlayers()[0].displayName; var cash = event.block.world.getScoreboard().getObjective('Cash').getScore(player).getValue(); if (cash >= 100){ event.block.executeCommand ('/summon Item ~ ~1 ~ {Item:{id:"minecraft:iron_ingot",Count:1b}}'); event.block.executeCommand ('/scoreboard players remove @p Cash 100') }} Now I would like to give this block to the player, so he can place it where he likes in order to summon the item where he need it. How can I do? I thought i should give the scripted block w/script thru /give command, but I don't know how. Thanks for any suggestion. EDIT: the script is written in Javascript. EDIT2: I managed to /give the block with script as NBTtag, but when placed down there's no script inside it.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.