How to make Rotatable Block [VIDEO TUTORIAL]

Started by Nuparu00 on

Topic category: User side tutorials

Active 1 year ago
Joined Aug 2013
Points:
1163

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
How to make Rotatable Block [VIDEO TUTORIAL]
Wed, 01/04/2017 - 20:31 (edited)

Hi. Because there is not his feature in MCreater itself and many of you need it for your mod , I decided to make a video tutorial how to make custom block rotatable , using PropertyDirection.
LINK

 

 

Edited by Klemen on Wed, 01/04/2017 - 20:31
Active 6 years ago
Joined Apr 2016
Points:
995

User statistics:

  • Modifications: 4
  • Forum topics: 22
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 273
RE:Got it Working!
Mon, 03/27/2017 - 11:40

@#56 

What did you do to get it to work?

Active 1 year ago
Joined Aug 2013
Points:
1163

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
RE:RE:Got it Working!
Mon, 03/27/2017 - 14:15

@#56.1 I've been writing some info/tips in comments of the video, so probably it is what helped him.

Active 6 years ago
Joined Apr 2016
Points:
995

User statistics:

  • Modifications: 4
  • Forum topics: 22
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 273
RE:RE:RE:Got it Working!
Fri, 04/07/2017 - 11:29

@#56.1.1 

Alright, I'll see if I can get it to work this time.

Active 6 years ago
Joined Apr 2016
Points:
995

User statistics:

  • Modifications: 4
  • Forum topics: 22
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 273
@Nuparu00
Fri, 04/07/2017 - 18:50

@Nuparu00

It already seems to be going better than before. I tried making a new block called "rotationtest" and copy/pasted the 1.9+ code from the video description into the block's code directly after the last naturally generated import. It recompiled fine.

However, when i tried to export the mod to test it (since testclient is extremeyl slow on my computer), the block suddenly had errors. This was the error message I got:

[spoiler]

Executing gradle command: clean build
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\Pylo\MCreator175>cd forge
C:\Pylo\MCreator175\forge>SET "JAVA_HOME=C:\Pylo\MCreator175\jdk64\"
C:\Pylo\MCreator175\forge>SET JAVA_EXE=%JAVA_HOME%\bin\java.exe
C:\Pylo\MCreator175\forge>SET PATH=%JAVA_HOME%\bin\;%PATH%
C:\Pylo\MCreator175\forge>gradlew -Dorg.gradle.jvmargs="-Xms128m -Xmx2538m" clean build 
This mapping 'snapshot_20161220' was designed for MC 1.11! Use at your own peril.
:clean
:deobfCompileDummyTask
:getVersionJson
:extractUserdev UP-TO-DATE
:downloadClient SKIPPED
:downloadServer SKIPPED
:splitServerJar SKIPPED
:mergeJars SKIPPED
:applyBinaryPatches SKIPPED
:deobfProvidedDummyTask
:extractDependencyATs SKIPPED
:extractMcpData SKIPPED
:extractMcpMappings SKIPPED
:genSrgs SKIPPED
:deobfMcMCP SKIPPED
:sourceApiJava
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
:compileJava
Download https://libraries.minecraft.net/com/mojang/realms/1.10.16/realms-1.10.1…
Download https://libraries.minecraft.net/com/mojang/realms/1.10.16/realms-1.10.1…
:compileJava FAILED
BUILD FAILED
C:\Pylo\MCreator175\forge\build\sources\main\java\mod\mcreator\mcreator_rotationTest.java:63: error: class, interface, or enum expected
import java.util.Random;
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 1 mins 32.037 secs
Picked up _JAVA_OPTIONS: -Xmx256M
C:\Pylo\MCreator175\forge>
Task completed with return code 0 in 96066 milliseconds

[/spoiler]

I don't know what it means by "expected enum", but it looks like that was the error

Active 1 year ago
Joined Aug 2013
Points:
1163

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
class, interface, or enum
Fri, 04/07/2017 - 19:25

class, interface, or enum expected generally happens if something like variable or method is out of a class (or if is something like import misspelled) and Java expects a class, interface or enum here. It is hard to say what is your case, make sure that the structure of the class is roughly like:

package
imports
public class mcreator_X {
init and other methods
static class X extends Block{

block related methods/fields

}
}

Active 6 years ago
Joined Apr 2016
Points:
995

User statistics:

  • Modifications: 4
  • Forum topics: 22
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 273
RE:class, interface, or enum
Mon, 04/10/2017 - 22:09

@#58 

I tried it again. It draws a pink squiggle line under the part in bold:

public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);

I'm guessing thaqt that's the part causing the error, but I don't know how to fix it.

Active 6 years ago
Joined Apr 2016
Points:
995

User statistics:

  • Modifications: 4
  • Forum topics: 22
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 273
RE:RE:class, interface, or enum
Fri, 04/14/2017 - 11:25

@#58.1 Do you know how to fix this?

Active 6 years ago
Joined Apr 2016
Points:
995

User statistics:

  • Modifications: 4
  • Forum topics: 22
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 273
@Nuparu00 
Wed, 05/03/2017 - 21:13

@Nuparu00 

I could really use some help. I don't know why it is not working or how to fix it

Active 6 years ago
Joined Apr 2015
Points:
745

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 18
Hi Naparu, your tutorial
Sat, 10/07/2017 - 18:29

Hi Naparu, your tutorial works really well, but only if I make blocks without an strange model, the normal cube. The problem is when I use a diferent model. The rotation works well because with the F3 I can see that it's rotated, but the texture it's an purple block. I think it's something with the .json so I paste here 3 links:

1. The block code, I think it works. 

https://pastebin.com/VUhCjHyT

2. The code of the model made with MrCrayfish.

https://pastebin.com/w63EvCAk

3. The code of the .json variants.

https://pastebin.com/hpeHRjuu

Well, after this three files. Can you help me for solve the purple block texture. I'm working with Minecraft 1.11.2 and MCreator 1.7.5

Waiting your answer MrpYA45. Thanks.

Active 1 year ago
Joined Aug 2013
Points:
1163

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
Hello. Can you post your
Sat, 10/07/2017 - 19:02

Hello. Can you post your console log, when you start the game?

Active 6 years ago
Joined Apr 2015
Points:
745

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 18
RE:Hello. Can you post your
Sat, 10/07/2017 - 19:30

@#61 Hi, thanks for answering, here you got the paste when the game start: https://pastebin.com/eX8wErks

Active 1 year ago
Joined Aug 2013
Points:
1163

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
I see that there is one extra
Sat, 10/07/2017 - 21:12

I see that there is one extra enclosing bracket in the blockstate file + also the last variant is not supposed to end with a comma.

Active 6 years ago
Joined Apr 2015
Points:
745

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 18
RE:I see that there is one extra
Sat, 10/07/2017 - 21:34

@#62 You can't imagine how much u has helped me, it works! You're amazing. Never leave this forums, thanks for all.

PD: I'm feeling a bit stupid for forget delete that comma xD

Active 6 years ago
Joined Apr 2015
Points:
745

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 18
Finishing with this help,
Sun, 10/08/2017 - 09:31

Finishing with this help, also I would like to know how rotate not only north, south, west and east. How I should add up and down. It's necesary something at the .json or also something in the code. Waiting for your answer MrpYA45. Thanks.